| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  | module Hbc | 
					
						
							|  |  |  |   class URL | 
					
						
							| 
									
										
										
										
											2017-08-08 18:10:13 +02:00
										 |  |  |     attr_reader :using, :revision, :trust_cert, :uri, :cookies, :referer, :data, :user_agent | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |     extend Forwardable | 
					
						
							|  |  |  |     def_delegators :uri, :path, :scheme, :to_s | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |     def self.from(*args, &block) | 
					
						
							|  |  |  |       if block_given? | 
					
						
							|  |  |  |         Hbc::DSL::StanzaProxy.once(self) { new(*block.call) } | 
					
						
							|  |  |  |       else | 
					
						
							|  |  |  |         new(*args) | 
					
						
							|  |  |  |       end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |     end | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |     def initialize(uri, options = {}) | 
					
						
							| 
									
										
										
										
											2017-10-03 08:29:20 +02:00
										 |  |  |       @uri        = URI(uri) | 
					
						
							| 
									
										
										
										
											2017-08-08 18:10:13 +02:00
										 |  |  |       @user_agent = options.fetch(:user_agent, :default) | 
					
						
							| 
									
										
										
										
											2016-09-24 13:52:43 +02:00
										 |  |  |       @cookies    = options[:cookies] | 
					
						
							|  |  |  |       @referer    = options[:referer] | 
					
						
							|  |  |  |       @using      = options[:using] | 
					
						
							|  |  |  |       @revision   = options[:revision] | 
					
						
							|  |  |  |       @trust_cert = options[:trust_cert] | 
					
						
							|  |  |  |       @data       = options[:data] | 
					
						
							|  |  |  |     end | 
					
						
							| 
									
										
										
										
											2016-08-18 22:11:42 +03:00
										 |  |  |   end | 
					
						
							|  |  |  | end |