Class: DaruLite::Offsets::Tick Abstract

Inherits:
DateOffsetType show all
Defined in:
lib/daru_lite/date_time/offsets.rb

Overview

This class is abstract.

Private superclass for Offsets with equal inter-frequencies.

Direct Known Subclasses

Day, Hour, Minute, Month, Second, Year

Instance Method Summary collapse

Methods inherited from DateOffsetType

#freq_string, #initialize

Methods inherited from DateOffset

#-@, #initialize

Constructor Details

This class inherits a constructor from DaruLite::Offsets::DateOffsetType

Instance Method Details

#+(other) ⇒ Object



105
106
107
# File 'lib/daru_lite/date_time/offsets.rb', line 105

def +(other)
  other + (@n * multiplier)
end

#-(other) ⇒ Object



109
110
111
# File 'lib/daru_lite/date_time/offsets.rb', line 109

def -(other)
  other - (@n * multiplier)
end

#==(other) ⇒ Object



113
114
115
# File 'lib/daru_lite/date_time/offsets.rb', line 113

def ==(other)
  other.is_a?(Tick) && period == other.period
end

#periodObject



117
118
119
# File 'lib/daru_lite/date_time/offsets.rb', line 117

def period
  @n * multiplier
end