Module: Bean::Machine::InstanceMethods
- Defined in:
- lib/bean/machine.rb
Instance Method Summary collapse
Instance Method Details
#bean ⇒ Object
11 12 13 |
# File 'lib/bean/machine.rb', line 11 def bean transfers.stateful.first end |
#transfer(*args, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/bean/machine.rb', line 15 def transfer(*args,&block) = args.last.is_a?(Hash) ? args.pop : {} amount = args.shift.to_money .reverse_merge!({ :amount => amount }) xfer = self.transfers.build() xfer.instance_eval(&block) xfer.save xfer end |