Class: Foobara::CommandConnectors::Http::Response
- Inherits:
-
Foobara::CommandConnector::Response
- Object
- Foobara::CommandConnector::Response
- Foobara::CommandConnectors::Http::Response
- Defined in:
- foobara-http-command-connector-0.0.26/src/http/response.rb
Instance Attribute Summary collapse
- #cookies ⇒ Object
-
#headers ⇒ Object
Returns the value of attribute headers.
Attributes inherited from Foobara::CommandConnector::Response
Instance Method Summary collapse
- #add_cookie(cookie_name, cookie_value, cookie_opts) ⇒ Object
- #add_header(header_name, header_value) ⇒ Object
-
#initialize(headers: nil, cookies: nil) ⇒ Response
constructor
A new instance of Response.
Methods inherited from Foobara::CommandConnector::Response
#command, #error, #outcome, #success?
Constructor Details
#initialize(headers: nil, cookies: nil) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 13 |
# File 'foobara-http-command-connector-0.0.26/src/http/response.rb', line 8 def initialize(headers: nil, cookies: nil, **) self.headers = headers self. = super(**) end |
Instance Attribute Details
#cookies ⇒ Object
15 16 17 |
# File 'foobara-http-command-connector-0.0.26/src/http/response.rb', line 15 def @cookies ||= [] end |
#headers ⇒ Object
Returns the value of attribute headers.
5 6 7 |
# File 'foobara-http-command-connector-0.0.26/src/http/response.rb', line 5 def headers @headers end |
Instance Method Details
#add_cookie(cookie_name, cookie_value, cookie_opts) ⇒ Object
19 20 21 |
# File 'foobara-http-command-connector-0.0.26/src/http/response.rb', line 19 def (, , ) << Cookie.new(, , **) end |
#add_header(header_name, header_value) ⇒ Object
23 24 25 26 |
# File 'foobara-http-command-connector-0.0.26/src/http/response.rb', line 23 def add_header(header_name, header_value) self.headers ||= {} headers[header_name] = header_value end |