Method: SimpleHttp::Connection#initialize

Defined in:
lib/simple_http/connection.rb

#initialize(url, options = {}) ⇒ Connection

Returns a new instance of Connection.



46
47
48
49
50
51
# File 'lib/simple_http/connection.rb', line 46

def initialize(url, options={})
  @uri = Addressable::URI.parse(url)
  self.class.default_options.keys.each do |key|
    instance_variable_set(:"@#{key}", options.fetch(key, self.class.default_options[key]))
  end
end