Class: Daru::Offsets::Tick Abstract
- Inherits:
-
DateOffset
- Object
- DateOffset
- Daru::Offsets::Tick
- Defined in:
- lib/daru/date_time/offsets.rb
Overview
This class is abstract.
Private superclass for Offsets with equal inter-frequencies.
Instance Method Summary collapse
- #+(date_time) ⇒ Object
- #-(date_time) ⇒ Object
-
#initialize(n = 1) ⇒ Tick
constructor
Initialize one of the subclasses of Tick with the number of the times the offset should be applied, which is the supplied as the argument.
Constructor Details
#initialize(n = 1) ⇒ Tick
Initialize one of the subclasses of Tick with the number of the times the offset should be applied, which is the supplied as the argument.
84 85 86 |
# File 'lib/daru/date_time/offsets.rb', line 84 def initialize n=1 @n = n end |
Instance Method Details
#+(date_time) ⇒ Object
88 89 90 |
# File 'lib/daru/date_time/offsets.rb', line 88 def + date_time date_time + @n*multiplier end |
#-(date_time) ⇒ Object
92 93 94 |
# File 'lib/daru/date_time/offsets.rb', line 92 def - date_time date_time - @n*multiplier end |