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

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

Instance Method Summary collapse

Instance Method Details

#call(res, options) ⇒ Object


112
113
114
115
116
# File 'lib/roar/json/json_api.rb', line 112

def call(res, options)
  tuples = (res.delete("links") || []).collect { |link| [link["rel"], link["href"]] }  # tuples.to_h

  ::Hash[tuples] # TODO: tuples.to_h when dropping < 2.1.
end