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
10
# File 'lib/hactor/hal/flat_collection.rb', line 6

def initialize(hash, options)
  @parent = options.fetch(:parent)
  @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

#parentObject (readonly)

Returns the value of attribute parent.



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

def parent
  @parent
end