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
130
131
132
# File 'lib/roar/json/hal.rb', line 125

def to_hash(*)
  links = []
  super.each { |hash|
    links += hash.values # [{"self"=>{"href": ..}}, ..]
  }

  {represented.rel.to_s => links} # {"self"=>[{"lang"=>"en", "href"=>"http://en.hit"}, {"lang"=>"de", "href"=>"http://de.hit"}]}
end