Class: Nodes::Collection
- Inherits:
-
Object
- Object
- Nodes::Collection
- Defined in:
- lib/buho_cfdi/nodes/collection.rb
Instance Attribute Summary collapse
-
#_collection ⇒ Object
Returns the value of attribute _collection.
-
#klass ⇒ Object
Returns the value of attribute klass.
Instance Method Summary collapse
- #add(params) ⇒ Object
- #all ⇒ Object
-
#initialize(klass) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(klass) ⇒ Collection
Returns a new instance of Collection.
5 6 7 8 |
# File 'lib/buho_cfdi/nodes/collection.rb', line 5 def initialize(klass) @klass = klass @_collection = [] end |
Instance Attribute Details
#_collection ⇒ Object
Returns the value of attribute _collection.
3 4 5 |
# File 'lib/buho_cfdi/nodes/collection.rb', line 3 def _collection @_collection end |
#klass ⇒ Object
Returns the value of attribute klass.
3 4 5 |
# File 'lib/buho_cfdi/nodes/collection.rb', line 3 def klass @klass end |
Instance Method Details
#add(params) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/buho_cfdi/nodes/collection.rb', line 14 def add(params) instance = klass.new(params) _collection << instance instance end |
#all ⇒ Object
10 11 12 |
# File 'lib/buho_cfdi/nodes/collection.rb', line 10 def all _collection end |