Class: Roar::Representer::JSON::HAL::LinkCollection

Inherits:
Feature::Hypermedia::LinkCollection show all
Defined in:
lib/roar/representer/json/hal.rb

Instance Method Summary collapse

Methods inherited from Feature::Hypermedia::LinkCollection

#[], #add

Constructor Details

#initialize(array_rels, *args) ⇒ LinkCollection

Returns a new instance of LinkCollection.



82
83
84
85
# File 'lib/roar/representer/json/hal.rb', line 82

def initialize(array_rels, *args)
  super(*args)
  @array_rels = array_rels.map(&:to_s)
end

Instance Method Details

#is_array?(rel) ⇒ Boolean

Returns:

  • (Boolean)


87
88
89
# File 'lib/roar/representer/json/hal.rb', line 87

def is_array?(rel)
  @array_rels.include?(rel.to_s)
end