Class: Http::Parameters
- Inherits:
-
Object
- Object
- Http::Parameters
- Includes:
- Chainable
- Defined in:
- lib/http/parameters.rb
Instance Method Summary collapse
- #[](field) ⇒ Object
- #[]=(field, value) ⇒ Object
-
#initialize(headers = {}) ⇒ Parameters
constructor
A new instance of Parameters.
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 |