Class: JSONAPI::Realizer::Action::Show

Inherits:
JSONAPI::Realizer::Action show all
Defined in:
lib/jsonapi/realizer/action/show.rb

Instance Attribute Summary collapse

Attributes inherited from JSONAPI::Realizer::Action

#payload

Instance Method Summary collapse

Methods inherited from JSONAPI::Realizer::Action

#call

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

#resourceObject

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

#modelObject



15
16
17
# File 'lib/jsonapi/realizer/action/show.rb', line 15

def model
  resource.model
end