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.
-
#ical_uid ⇒ Object
readonly
Returns the value of attribute ical_uid.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#organizer ⇒ Object
readonly
Returns the value of attribute organizer.
-
#sequence ⇒ Object
readonly
Returns the value of attribute sequence.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#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.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#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
- #resources ⇒ 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 20 21 22 23 24 |
# File 'lib/gaah/calendar/event.rb', line 6 def initialize(json) store_json(json) @id = json['id'] @ical_uid = json['iCalUID'] @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' @organizer = Who.new(json['organizer']) if json['organizer'] @sequence = json['sequence'] @status = json['status'] @url = json['htmlLink'] 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 |
#ical_uid ⇒ Object (readonly)
Returns the value of attribute ical_uid.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def ical_uid @ical_uid 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 |
#organizer ⇒ Object (readonly)
Returns the value of attribute organizer.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def organizer @organizer end |
#sequence ⇒ Object (readonly)
Returns the value of attribute sequence.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def sequence @sequence end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def status @status 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 |
#url ⇒ Object (readonly)
Returns the value of attribute url.
4 5 6 |
# File 'lib/gaah/calendar/event.rb', line 4 def url @url 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
49 |
# File 'lib/gaah/calendar/event.rb', line 49 def ; creator; end |
#content ⇒ Object
50 |
# File 'lib/gaah/calendar/event.rb', line 50 def content; description; end |
#marshal_dump ⇒ Object
55 56 57 58 59 |
# File 'lib/gaah/calendar/event.rb', line 55 def marshal_dump [@id, nil, @updated, @summary, @description, @location, @creator, @when, @attendees, @transparency, @visibility, @ical_uid, @organizer, @sequence, @status, @url] end |
#marshal_load(array) ⇒ Object
61 62 63 64 65 |
# File 'lib/gaah/calendar/event.rb', line 61 def marshal_load(array) @id, _, @updated, @summary, @description, @location, @creator, @when, @attendees, @transparency, @visibility, @ical_uid, @organizer, @sequence, @status, @url = array end |
#resources ⇒ Object
44 45 46 |
# File 'lib/gaah/calendar/event.rb', line 44 def resources who.select(&:is_resource?) end |
#title ⇒ Object
51 |
# File 'lib/gaah/calendar/event.rb', line 51 def title; summary; end |
#to_json(*args) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/gaah/calendar/event.rb', line 26 def to_json(*args) { id: @id, updated: @updated, summary: @summary, description: @description, location: @location, creator: @creator, when: @when, attendees: @attendees, transparency: @transparency, visibility: @visibility, status: @status, url: @url, resources: resources, }.to_json end |
#where ⇒ Object
52 |
# File 'lib/gaah/calendar/event.rb', line 52 def where; location; end |
#who ⇒ Object
53 |
# File 'lib/gaah/calendar/event.rb', line 53 def who; attendees; end |