Module: Core::Io::Json::Grammar::Resource

Included in:
Endpoint::BasicHandler::Associations::BelongsTo::Handler::Association, Actions
Defined in:
app/api/core/io/json/grammar.rb

Instance Method Summary collapse

Instance Method Details

#resource_details(endpoint, object, options, stream) ⇒ Object



184
185
186
187
188
189
190
191
192
# File 'app/api/core/io/json/grammar.rb', line 184

def resource_details(endpoint, object, options, stream)
  stream.block('actions') do |nested_stream|
    endpoint
      .send(:actions, object, options.merge(target: object))
      .map { |action, url| nested_stream.attribute(action, url) }
    actions(object, options, nested_stream)
  end
  stream.attribute('uuid', object.uuid)
end