Class: Formstack::Collection
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Formstack::Collection
- Defined in:
- lib/formstack/collection.rb
Instance Method Summary collapse
- #create(*args) ⇒ Object
-
#initialize(array, klass:, context: []) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(array, klass:, context: []) ⇒ Collection
Returns a new instance of Collection.
5 6 7 8 9 |
# File 'lib/formstack/collection.rb', line 5 def initialize(array, klass:, context: []) @klass = klass @context = context super(array) end |
Instance Method Details
#create(*args) ⇒ Object
11 12 13 |
# File 'lib/formstack/collection.rb', line 11 def create(*args) @klass.create(*@context, *args) end |