Module: Leif::CollectionJson::Linked
- Included in:
- Collection, Collection::Item
- Defined in:
- lib/leif/collection_json.rb
Instance Method Summary collapse
Instance Method Details
#link_href(relation) ⇒ Object
7 8 9 |
# File 'lib/leif/collection_json.rb', line 7 def link_href(relation) links.find {|link| link.fetch('rel') == relation }.fetch('href') end |
#link_relations ⇒ Object
11 12 13 |
# File 'lib/leif/collection_json.rb', line 11 def link_relations links.map {|link| link.fetch('rel') } end |
#links ⇒ Object
15 16 17 18 |
# File 'lib/leif/collection_json.rb', line 15 def links return [] unless has_key?('links') fetch('links') end |