Class: Daru::Offsets::DateOffsetType

Inherits:
DateOffset show all
Defined in:
lib/daru/date_time/offsets.rb

Direct Known Subclasses

MonthBegin, MonthEnd, Tick, YearBegin, YearEnd

Instance Method Summary collapse

Methods inherited from DateOffset

#+, #-, #-@

Constructor Details

#initializeDateOffsetType

Initialize one of the subclasses of DateOffsetType 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.



94
95
96
# File 'lib/daru/date_time/offsets.rb', line 94

def initialize n=1
  @n = n
end

Instance Method Details

#freq_stringObject



98
99
100
# File 'lib/daru/date_time/offsets.rb', line 98

def freq_string
  (@n == 1 ? '' : @n.to_s) + self.class::FREQ
end