Class: Ballista::Frequencies::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/ballista/frequencies/base.rb

Overview

Base class for frequency subclasses

Direct Known Subclasses

Monthly, Weekly

Instance Method Summary collapse

Constructor Details

#initialize(action, start, stop) ⇒ Base

Returns a new instance of Base.



8
9
10
11
12
13
14
# File 'lib/ballista/frequencies/base.rb', line 8

def initialize(action, start, stop)
  @name = action[:name]
  @start = action[:starts] ? Date.parse(action[:starts]) : start
  @stop = action[:stops] ? Date.parse(action[:stops]) : stop
  @amount = action[:amount].to_i
  @when = action[:when]
end

Instance Method Details

#entry(date) ⇒ Object



16
17
18
# File 'lib/ballista/frequencies/base.rb', line 16

def entry(date)
  [date, @name, @amount]
end