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

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

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

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


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

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