Class: Gaah::Calendar::Event
- Defined in:
- lib/gaah/calendar/event.rb
Instance Attribute Summary collapse
-
#attendees ⇒ Object
readonly
Returns the value of attribute attendees.
-
#creator ⇒ Object
readonly
Returns the value of attribute creator.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#transparency ⇒ Object
readonly
Returns the value of attribute transparency.
-
#updated ⇒ Object
readonly
Returns the value of attribute updated.
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
-
#when ⇒ Object
readonly
Returns the value of attribute when.
Attributes inherited from ApiModel
Instance Method Summary collapse
-
#author ⇒ Object
V2 -> V3.
- #content ⇒ Object
-
#initialize(json) ⇒ Event
constructor
A new instance of Event.
- #marshal_dump ⇒ Object
- #marshal_load(array) ⇒ Object
- #title ⇒ Object
- #to_json(*args) ⇒ Object
- #where ⇒ Object
- #who ⇒ Object
Methods inherited from ApiModel
Constructor Details
#initialize(json) ⇒ Event
Returns a new instance of Event.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/gaah/calendar/event.rb', line 6 def initialize(json) store_json(json) @id = json['id'] @updated = Time.parse(json['updated']) @summary = json['summary'].to_s @description = json['description'].to_s @location = json['location'].to_s @creator = Who.new(json['creator']) if json['creator'] @when = parse_when @attendees = parse_attendees @transparency = json['transparency'].to_s @visibility = json['visibility'] || 'default' end |
Instance Attribute Details
#attendees ⇒ Object (readonly)
Returns the value of attribute attendees.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def attendees @attendees end |
#creator ⇒ Object (readonly)
Returns the value of attribute creator.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def creator @creator end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def description @description end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def location @location end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def summary @summary end |
#transparency ⇒ Object (readonly)
Returns the value of attribute transparency.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def transparency @transparency end |
#updated ⇒ Object (readonly)
Returns the value of attribute updated.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def updated @updated end |
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def visibility @visibility end |
#when ⇒ Object (readonly)
Returns the value of attribute when.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def when @when end |
Instance Method Details
#author ⇒ Object
V2 -> V3
37 |
# File 'lib/gaah/calendar/event.rb', line 37 def ; creator; end |
#content ⇒ Object
38 |
# File 'lib/gaah/calendar/event.rb', line 38 def content; description; end |
#marshal_dump ⇒ Object
43 44 45 |
# File 'lib/gaah/calendar/event.rb', line 43 def marshal_dump [@id, nil, @updated, @summary, @description, @location, @creator, @when, @attendees, @transparency, @visibility] end |
#marshal_load(array) ⇒ Object
47 48 49 |
# File 'lib/gaah/calendar/event.rb', line 47 def marshal_load(array) @id, _, @updated, @summary, @description, @location, @creator, @when, @attendees, @transparency, @visibility = array end |
#title ⇒ Object
39 |
# File 'lib/gaah/calendar/event.rb', line 39 def title; summary; end |
#to_json(*args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/gaah/calendar/event.rb', line 21 def to_json(*args) { id: @id, updated: @updated, summary: @summary, description: @description, location: @location, creator: @creator, when: @when, attendees: @attendees, transparency: @transparency, visibility: @visibility, }.to_json end |
#where ⇒ Object
40 |
# File 'lib/gaah/calendar/event.rb', line 40 def where; location; end |
#who ⇒ Object
41 |
# File 'lib/gaah/calendar/event.rb', line 41 def who; attendees; end |