Class: Google::CalendarListEntry
- Inherits:
-
Object
- Object
- Google::CalendarListEntry
- Defined in:
- lib/google/calendar_list_entry.rb
Overview
Represents a Google Calendar List Entry
See developers.google.com/google-apps/calendar/v3/reference/calendarList#resource
Attributes
-
id
- The Google assigned id of the calendar. Read only. -
summary
- Title of the calendar. Read-only. -
time_zone
- The time zone of the calendar. Optional. Read-only. -
access_role
- The effective access role that the authenticated user has on the calendar. Read-only. -
primary?
- Whether the calendar is the primary calendar of the authenticated user. Read-only.
Instance Attribute Summary collapse
-
#access_role ⇒ Object
readonly
Returns the value of attribute access_role.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#primary ⇒ Object
(also: #primary?)
readonly
Returns the value of attribute primary.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params, connection) ⇒ CalendarListEntry
constructor
A new instance of CalendarListEntry.
- #to_calendar ⇒ Object
Constructor Details
#initialize(params, connection) ⇒ CalendarListEntry
Returns a new instance of CalendarListEntry.
20 21 22 23 24 25 26 27 |
# File 'lib/google/calendar_list_entry.rb', line 20 def initialize(params, connection) @id = params['id'] @summary = params['summary'] @time_zone = params['timeZone'] @access_role = params['accessRole'] @primary = params.fetch('primary', false) @connection = connection end |
Instance Attribute Details
#access_role ⇒ Object (readonly)
Returns the value of attribute access_role.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def access_role @access_role end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def connection @connection end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def id @id end |
#primary ⇒ Object (readonly) Also known as: primary?
Returns the value of attribute primary.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def primary @primary end |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def summary @summary end |
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
17 18 19 |
# File 'lib/google/calendar_list_entry.rb', line 17 def time_zone @time_zone end |
Class Method Details
.build_from_google_feed(response, connection) ⇒ Object
33 34 35 36 |
# File 'lib/google/calendar_list_entry.rb', line 33 def self.build_from_google_feed(response, connection) items = response['items'] items.collect { |item| CalendarListEntry.new(item, connection) } end |