Class: Daru::Offsets::Tick Abstract

Inherits:
DateOffsetType show all
Defined in:
lib/daru/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

Methods inherited from DateOffset

#-@

Constructor Details

#initializeObject

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.

Parameters:

  • n (Integer)

    The number of times an offset should be applied.



104
105
106
# File 'lib/daru/date_time/offsets.rb', line 104

def + date_time
  date_time + @n*multiplier
end

Instance Method Details

#+(date_time) ⇒ Object

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.

Parameters:

  • n (Integer)

    The number of times an offset should be applied.



104
105
106
# File 'lib/daru/date_time/offsets.rb', line 104

def + date_time
  date_time + @n*multiplier
end

#-(date_time) ⇒ Object



108
109
110
# File 'lib/daru/date_time/offsets.rb', line 108

def - date_time
  date_time - @n*multiplier
end