Class: Http::Parameters

Inherits:
Object
  • Object
show all
Includes:
Chainable
Defined in:
lib/http/parameters.rb

Instance Method Summary collapse

Methods included from Chainable

#accept, #connect, #default_headers, #default_headers=, #delete, #get, #head, #options, #patch, #post, #put, #request, #trace, #with_headers

Constructor Details

#initialize(headers = {}) ⇒ Parameters

Returns a new instance of Parameters.



5
6
7
# File 'lib/http/parameters.rb', line 5

def initialize(headers = {})
  self.default_headers = headers
end

Instance Method Details

#[](field) ⇒ Object



13
14
15
# File 'lib/http/parameters.rb', line 13

def [](field)
  default_headers[field.downcase]
end

#[]=(field, value) ⇒ Object



9
10
11
# File 'lib/http/parameters.rb', line 9

def []=(field, value)
  default_headers[field.downcase] = value
end