Class: Clavius::Calculation::DaysFrom
- Inherits:
-
Object
- Object
- Clavius::Calculation::DaysFrom
- Defined in:
- lib/clavius/calculation/days_from.rb
Instance Method Summary collapse
- #after(origin) ⇒ Object
- #before(origin) ⇒ Object
-
#initialize(schedule, number) ⇒ DaysFrom
constructor
A new instance of DaysFrom.
Constructor Details
#initialize(schedule, number) ⇒ DaysFrom
Returns a new instance of DaysFrom.
7 8 9 10 11 12 |
# File 'lib/clavius/calculation/days_from.rb', line 7 def initialize(schedule, number) @schedule = schedule @number = Integer(number) fail ArgumentError, 'negative number' if @number.negative? end |
Instance Method Details
#after(origin) ⇒ Object
18 19 20 |
# File 'lib/clavius/calculation/days_from.rb', line 18 def after(origin) calculated_day(:after, origin) end |
#before(origin) ⇒ Object
14 15 16 |
# File 'lib/clavius/calculation/days_from.rb', line 14 def before(origin) calculated_day(:before, origin) end |