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


173
174
175
176
177
178
179
180
181
# File 'app/api/core/io/json/grammar.rb', line 173

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