class SaveTheMonth::RecipeDsl

Attributes

charge_dsl[RW]
expected_balance[RW]
payment_dsl[RW]

Public Class Methods

new() click to toggle source
# File lib/recipe_dsl.rb, line 10
def initialize
  self.expected_balance = ExpectedBalance.new
  self.payment_dsl = PaymentDsl.new
  self.charge_dsl = ChargeDsl.new
end

Public Instance Methods

final_date(date) click to toggle source
# File lib/recipe_dsl.rb, line 20
def final_date(date)
  expected_balance.final_date = Date.parse(date)
end
initial_amount(amount) click to toggle source
# File lib/recipe_dsl.rb, line 24
def initial_amount(amount)
  expected_balance.initial_amount = amount
end
initial_date(date) click to toggle source
# File lib/recipe_dsl.rb, line 16
def initial_date(date)
  expected_balance.initial_date = Date.parse(date)
end
to_charge(&block) click to toggle source
# File lib/recipe_dsl.rb, line 32
def to_charge(&block)
  charge_dsl.evaluate_recipe(expected_balance, &block)
end
to_pay(&block) click to toggle source
# File lib/recipe_dsl.rb, line 28
def to_pay(&block)
  payment_dsl.evaluate_recipe(expected_balance, &block)
end