Class: JSONAPI::Realizer::Action::Show
- Inherits:
-
JSONAPI::Realizer::Action
- Object
- JSONAPI::Realizer::Action
- JSONAPI::Realizer::Action::Show
- Defined in:
- lib/jsonapi/realizer/action/show.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
Returns the value of attribute resource.
Attributes inherited from JSONAPI::Realizer::Action
Instance Method Summary collapse
-
#initialize(payload:, headers:, type:) ⇒ Show
constructor
A new instance of Show.
- #model ⇒ Object
Methods inherited from JSONAPI::Realizer::Action
Constructor Details
#initialize(payload:, headers:, type:) ⇒ Show
Returns a new instance of Show.
8 9 10 11 12 13 |
# File 'lib/jsonapi/realizer/action/show.rb', line 8 def initialize(payload:, headers:, type:) @payload = payload @headers = headers @type = type @resource = resource_class.new(adapter.find_via_call(relation, id)) end |
Instance Attribute Details
#resource ⇒ Object
Returns the value of attribute resource.
6 7 8 |
# File 'lib/jsonapi/realizer/action/show.rb', line 6 def resource @resource end |
Instance Method Details
#model ⇒ Object
15 16 17 |
# File 'lib/jsonapi/realizer/action/show.rb', line 15 def model resource.model end |