Class: Phlexi::Field::Structure::NamespaceCollection
- Includes:
- Enumerable
- Defined in:
- lib/phlexi/field/structure/namespace_collection.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(key, parent:, collection: nil, &block) ⇒ NamespaceCollection
constructor
A new instance of NamespaceCollection.
- #object ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(key, parent:, collection: nil, &block) ⇒ NamespaceCollection
Returns a new instance of NamespaceCollection.
9 10 11 12 13 14 15 16 17 |
# File 'lib/phlexi/field/structure/namespace_collection.rb', line 9 def initialize(key, parent:, collection: nil, &block) raise ArgumentError, "block is required" unless block.present? super(key, parent: parent) @collection = collection @block = block each(&block) end |
Instance Method Details
#object ⇒ Object
19 20 21 |
# File 'lib/phlexi/field/structure/namespace_collection.rb', line 19 def object @collection end |