Class: RiCal::OccurrencePeriod

Inherits:
Object
  • Object
show all
Defined in:
lib/ri_cal/occurrence_period.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dtstart, dtend) ⇒ OccurrencePeriod


4
5
6
7
# File 'lib/ri_cal/occurrence_period.rb', line 4

def initialize(dtstart, dtend)
  @dtstart = dtstart
  @dtend = dtend
end

Instance Attribute Details

#dtendObject (readonly)

Returns the value of attribute dtend


3
4
5
# File 'lib/ri_cal/occurrence_period.rb', line 3

def dtend
  @dtend
end

#dtstartObject (readonly)

Returns the value of attribute dtstart


3
4
5
# File 'lib/ri_cal/occurrence_period.rb', line 3

def dtstart
  @dtstart
end

Instance Method Details

#<=>(other) ⇒ Object


13
14
15
# File 'lib/ri_cal/occurrence_period.rb', line 13

def <=>(other)
  [dtstart, dtend] <=> [other.dtstart, other.dtend]
end

#to_sObject


9
10
11
# File 'lib/ri_cal/occurrence_period.rb', line 9

def to_s
  "op:#{dtstart}-#{dtend}"
end