Class: Modern::Descriptor::Response
- Defined in:
- lib/modern/descriptor/response.rb
Instance Attribute Summary collapse
-
#content_by_type ⇒ Object
readonly
Returns the value of attribute content_by_type.
Instance Method Summary collapse
-
#initialize(fields) ⇒ Response
constructor
A new instance of Response.
Methods included from Struct::Copy
Constructor Details
#initialize(fields) ⇒ Response
Returns a new instance of Response.
19 20 21 22 23 |
# File 'lib/modern/descriptor/response.rb', line 19 def initialize(fields) super @content_by_type = content.map { |c| [c.media_type, c] }.to_h.freeze end |
Instance Attribute Details
#content_by_type ⇒ Object (readonly)
Returns the value of attribute content_by_type.
17 18 19 |
# File 'lib/modern/descriptor/response.rb', line 17 def content_by_type @content_by_type end |