Class: GCal::Calendar
- Inherits:
-
Object
- Object
- GCal::Calendar
- Defined in:
- lib/gcal/calendar.rb
Instance Attribute Summary collapse
-
#access_level ⇒ Object
Returns the value of attribute access_level.
-
#author_email ⇒ Object
Returns the value of attribute author_email.
-
#author_name ⇒ Object
Returns the value of attribute author_name.
-
#color ⇒ Object
Returns the value of attribute color.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
-
#id ⇒ Object
Returns the value of attribute id.
-
#link ⇒ Object
Returns the value of attribute link.
-
#published_at ⇒ Object
Returns the value of attribute published_at.
-
#selected ⇒ Object
Returns the value of attribute selected.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#access_level ⇒ Object
Returns the value of attribute access_level.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def access_level @access_level end |
#author_email ⇒ Object
Returns the value of attribute author_email.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def @author_email end |
#author_name ⇒ Object
Returns the value of attribute author_name.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def @author_name end |
#color ⇒ Object
Returns the value of attribute color.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def color @color end |
#hidden ⇒ Object
Returns the value of attribute hidden.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def hidden @hidden end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def id @id end |
#link ⇒ Object
Returns the value of attribute link.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def link @link end |
#published_at ⇒ Object
Returns the value of attribute published_at.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def published_at @published_at end |
#selected ⇒ Object
Returns the value of attribute selected.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def selected @selected end |
#timezone ⇒ Object
Returns the value of attribute timezone.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def timezone @timezone end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
3 4 5 |
# File 'lib/gcal/calendar.rb', line 3 def updated_at @updated_at end |
Class Method Details
.parse(entry, path) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gcal/calendar.rb', line 20 def parse(entry, path) calendar_home_url = 'http://www.google.com/calendar/feeds' parse_time = Time.respond_to?(:parse) calendar = self.new # common info calendar.id = entry['id'][0].gsub(calendar_home_url + path, '') calendar.title = entry['title'][0]['content'] calendar.link = entry['link'][0]['href'] calendar.access_level = entry['accesslevel'][0]['value'] calendar.color = entry['color'][0]['value'] calendar.hidden = entry['hidden'][0]['value'] == 'true' calendar.selected = entry['selected'][0]['value'] == 'true' # time info calendar.timezone = entry['timezone'][0]['value'] calendar.updated_at = parse_time ? Time.parse(entry['updated'][0]) : entry['updated'][0] calendar.published_at = parse_time ? Time.parse(entry['published'][0]) : entry['published'][0] # author = entry['author'][0] calendar. = ['name'] ? ['name'][0] : '' calendar. = ['email'] ? ['email'][0] : '' calendar end |
Instance Method Details
#hidden? ⇒ Boolean
7 8 9 |
# File 'lib/gcal/calendar.rb', line 7 def hidden? hidden end |
#selected? ⇒ Boolean
15 16 17 |
# File 'lib/gcal/calendar.rb', line 15 def selected? selected end |
#visible ⇒ Object
11 12 13 |
# File 'lib/gcal/calendar.rb', line 11 def visible !hidden? end |