diff options
author | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-07-10 13:25:25 +0200 |
---|---|---|
committer | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-07-10 13:25:25 +0200 |
commit | 8e20191b693b9b1c91d487f58c455150b004719a (patch) | |
tree | b35bdd0ff602910b2f5826f856fcd3134e748e78 /lib/sublab_calendar/occurrence.rb | |
parent | c4974555d8cc11f2465f47fe86078be0d0bd30e4 (diff) |
split class into multiple files and use new baikal server instance
Diffstat (limited to 'lib/sublab_calendar/occurrence.rb')
-rw-r--r-- | lib/sublab_calendar/occurrence.rb | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/lib/sublab_calendar/occurrence.rb b/lib/sublab_calendar/occurrence.rb new file mode 100644 index 0000000..fad58a8 --- /dev/null +++ b/lib/sublab_calendar/occurrence.rb @@ -0,0 +1,38 @@ +module SublabCalendar + + class Occurrence < SimpleDelegator + + attr_reader :event + + def initialize(occurrence, event) + @event = event + super(occurrence) + end + + def to_h + { + summary: summary, + start: start_time, + end: end_time + } + end + + def inspect + to_s + end + + def summary + event.summary + end + + def description + event.description + end + + def to_s + "<#{self.class} #{self.to_h}>" + end + + end + +end |