Module: Granite::AssignData::ClassMethods
- Defined in:
- lib/granite/assign_data.rb
Instance Method Summary collapse
-
#assign_data(*methods, **options, &block) ⇒ Object
Defines a callback to call when assigning data from business action to model.
Instance Method Details
#assign_data(*methods, **options, &block) ⇒ Object
Defines a callback to call when assigning data from business action to model.
21 22 23 24 |
# File 'lib/granite/assign_data.rb', line 21 def assign_data(*methods, **, &block) self.data_assignments += methods.map { |method| DataAssignment.new(method, ) } self.data_assignments += [DataAssignment.new(block, )] if block end |