Class: Modern::Descriptor::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/modern/descriptor/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Struct::Copy

#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_typeObject (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