Class: Ballista::Frequencies::Base
- Inherits:
-
Object
- Object
- Ballista::Frequencies::Base
- Defined in:
- lib/ballista/frequencies/base.rb
Overview
Base class for frequency subclasses
Instance Method Summary collapse
- #entry(date) ⇒ Object
-
#initialize(action, start, stop) ⇒ Base
constructor
A new instance of Base.
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 |