Class: Noventius::PostProcessors::DateRanges::BaseRange

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/noventius/post_processors/date_ranges.rb

Direct Known Subclasses

DayRange, MonthRange

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date) ⇒ BaseRange

Returns a new instance of BaseRange.



99
100
101
# File 'lib/noventius/post_processors/date_ranges.rb', line 99

def initialize(date)
  @date = date
end

Instance Attribute Details

#dateObject (readonly)

Returns the value of attribute date.



97
98
99
# File 'lib/noventius/post_processors/date_ranges.rb', line 97

def date
  @date
end

Instance Method Details

#<=>(other) ⇒ Object



107
108
109
# File 'lib/noventius/post_processors/date_ranges.rb', line 107

def <=>(other)
  @date <=> other.date
end

#succObject



103
104
105
# File 'lib/noventius/post_processors/date_ranges.rb', line 103

def succ
  self.class.new(@date + @step)
end