Class: Roar::JSON::HAL::Links::ArrayLink::Representer
- Inherits:
-
Representable::Decorator
- Object
- Representable::Decorator
- Roar::JSON::HAL::Links::ArrayLink::Representer
- Includes:
- Representable::JSON::Collection
- Defined in:
- lib/roar/json/hal.rb
Overview
- Hyperlink, Hyperlink
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
125 126 127 128 129 |
# File 'lib/roar/json/hal.rb', line 125 def to_hash(*) links = super.flat_map(&:values) # [{"self"=>{"href": ..}}, ..] { represented.rel.to_s => links } # {"self"=>[{"lang"=>"en", "href"=>"http://en.hit"}, {"lang"=>"de", "href"=>"http://de.hit"}]} end |