Method: Intermodal::Mapping::Presenter.call
- Defined in:
- lib/intermodal/mapping/presenter.rb
.call(resource, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/intermodal/mapping/presenter.rb', line 23 def call(resource, = {}) _scope = [:scope] || :default if [:root] || [:always_nest_collections] { ([:root].is_a?(TrueClass) || [:root].nil? ? model_name(resource) : [:root]) => map_attributes(resource, _scope) } else map_attributes(resource, _scope) end end |