File: occurrence_period.rb

package info (click to toggle)
mhc 1.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,452 kB
  • sloc: ruby: 12,700; lisp: 7,577; makefile: 70; sh: 68
file content (17 lines) | stat: -rw-r--r-- 314 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module RiCal
  class OccurrencePeriod
    attr_reader :dtstart, :dtend
    def initialize(dtstart, dtend)
      @dtstart = dtstart
      @dtend = dtend
    end
    
    def to_s
      "op:#{dtstart}-#{dtend}"
    end
    
    def <=>(other)
      [dtstart, dtend] <=> [other.dtstart, other.dtend]
    end
  end
end