Class: Roar::JSON::HAL::Links::ArrayLink::Representer

Inherits:
Representable::Decorator
  • Object
show all
Includes:
Representable::JSON::Collection
Defined in:
lib/roar/json/hal.rb

Overview

Hyperlink, Hyperlink

Instance Method Summary collapse

Instance Method Details

#to_hashObject



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