Class: Hactor::HAL::FlatCollection
- Inherits:
-
Array
- Object
- Array
- Hactor::HAL::FlatCollection
- Defined in:
- lib/hactor/hal/flat_collection.rb
Instance Attribute Summary collapse
-
#item_class ⇒ Object
readonly
Returns the value of attribute item_class.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(hash, options) ⇒ FlatCollection
constructor
A new instance of FlatCollection.
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, ) @parent = .fetch(:parent) @item_class = .fetch(:item_class) super flatten(hash) end |
Instance Attribute Details
#item_class ⇒ Object (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 |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
4 5 6 |
# File 'lib/hactor/hal/flat_collection.rb', line 4 def parent @parent end |