Class: Hactor::HAL::FlatCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/hactor/hal/flat_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, options = {}) ⇒ FlatCollection

Returns a new instance of FlatCollection.



6
7
8
9
# File 'lib/hactor/hal/flat_collection.rb', line 6

def initialize(hash, options={})
  @item_class = options.fetch(:item_class)
  super flatten(hash)
end

Instance Attribute Details

#item_classObject (readonly)

Returns the value of attribute item_class.



4
5
6
# File 'lib/hactor/hal/flat_collection.rb', line 4

def item_class
  @item_class
end