Class: Html2rss::RequestService::Response
- Inherits:
-
Object
- Object
- Html2rss::RequestService::Response
- Defined in:
- lib/html2rss/request_service/response.rb
Overview
To be used by strategies to provide their response.
Instance Attribute Summary collapse
-
#body ⇒ String
readonly
The body of the response.
-
#headers ⇒ Hash<String, Object>
readonly
The headers of the response.
Instance Method Summary collapse
-
#initialize(body:, headers: {}) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(body:, headers: {}) ⇒ Response
Returns a new instance of Response.
11 12 13 14 15 16 17 18 |
# File 'lib/html2rss/request_service/response.rb', line 11 def initialize(body:, headers: {}) @body = body headers = headers.dup headers.transform_keys!(&:to_s) @headers = headers end |
Instance Attribute Details
#body ⇒ String (readonly)
Returns the body of the response.
21 22 23 |
# File 'lib/html2rss/request_service/response.rb', line 21 def body @body end |
#headers ⇒ Hash<String, Object> (readonly)
Returns the headers of the response.
24 25 26 |
# File 'lib/html2rss/request_service/response.rb', line 24 def headers @headers end |