Module: Core::Endpoint::BasicHandler::Json

Included in:
Core::Endpoint::BasicHandler
Defined in:
app/api/core/endpoint/basic_handler.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details


15
16
17
# File 'app/api/core/endpoint/basic_handler.rb', line 15

def related
  []
end

#root_jsonObject


11
12
13
# File 'app/api/core/endpoint/basic_handler.rb', line 11

def root_json
  'unknown'
end

#tree_for(_object, _options) ⇒ Object


19
20
21
22
23
24
25
26
# File 'app/api/core/endpoint/basic_handler.rb', line 19

def tree_for(_object, _options)
  associations, actions = {}, {}
  related.each { |r| r.separate(associations, actions) }
  Core::Io::Json::Grammar::Root.new(
    root_json,
    associations.merge('actions' => Core::Io::Json::Grammar::Actions.new(self, actions))
  )
end