Class: Roar::JSON::JSONAPI::Renderer::Links Private

Inherits:
Object
  • Object
show all
Defined in:
lib/roar/json/json_api.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#call(res, _options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



125
126
127
128
129
130
131
# File 'lib/roar/json/json_api.rb', line 125

def call(res, _options)
  tuples = (res.delete('links') || []).collect { |link|
    [JSONAPI::MemberName.(link['rel']), link['href']]
  }

  ::Hash[tuples] # NOTE: change to tuples.to_h when dropping < 2.1.
end