Class: DaruLite::Offsets::Month

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

Overview

Create an months offset

Examples:

Create a Month offset

offset = DaruLite::Offsets::Month.new(5)
offset + DateTime.new(2012,5,1,4,3)
#=> #<DateTime: 2012-10-01T04:03:00+00:00 ((2456202j,14580s,0n),+0s,2299161j)>

Constant Summary collapse

FREQ =
'MONTH'.freeze

Instance Method Summary collapse

Methods inherited from Tick

#==, #period

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



192
193
194
# File 'lib/daru_lite/date_time/offsets.rb', line 192

def +(other)
  other >> @n
end

#-(other) ⇒ Object



196
197
198
# File 'lib/daru_lite/date_time/offsets.rb', line 196

def -(other)
  other << @n
end