class SaveTheMonth::PaymentDsl
Attributes
expected_balance[RW]
Public Instance Methods
evaluate_recipe(expected_balance, &recipe)
click to toggle source
# File lib/payment_dsl.rb, line 5 def evaluate_recipe(expected_balance, &recipe) self.expected_balance = expected_balance instance_eval(&recipe) end
method_missing(meth, *args, &blk)
click to toggle source
# File lib/payment_dsl.rb, line 10 def method_missing(meth, *args, &blk) payment_name = meth if block_given? expected_balance.add_payment(payment_name, &blk) else amount, options = args[0], args[1] amount_date = Date.parse(options[:at]) expected_balance.add_timed_payment(payment_name, amount, amount_date) end end