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:, scope: nil, type:) ⇒ Show
constructor
A new instance of Show.
- #model ⇒ Object
Methods inherited from JSONAPI::Realizer::Action
Constructor Details
#initialize(payload:, headers:, scope: nil, type:) ⇒ Show
Returns a new instance of Show.
7 8 9 10 11 12 13 |
# File 'lib/jsonapi/realizer/action/show.rb', line 7 def initialize(payload:, headers:, scope: nil, type:) @type = type super(payload: payload, headers: headers, scope: scope) @resource = resource_class.new(adapter.find_via_call(relation, id)) end |
Instance Attribute Details
#resource ⇒ Object
Returns the value of attribute resource.
5 6 7 |
# File 'lib/jsonapi/realizer/action/show.rb', line 5 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 |