Class: Googlecalendar::Calendar
- Inherits:
-
Object
- Object
- Googlecalendar::Calendar
- Defined in:
- lib/googlecalendar/calendar.rb
Instance Attribute Summary collapse
-
#events ⇒ Object
Returns the value of attribute events.
-
#method ⇒ Object
Returns the value of attribute method.
-
#product_id ⇒ Object
Returns the value of attribute product_id.
-
#scale ⇒ Object
Returns the value of attribute scale.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
Instance Attribute Details
#events ⇒ Object
Returns the value of attribute events.
3 4 5 |
# File 'lib/googlecalendar/calendar.rb', line 3 def events @events end |
#method ⇒ Object
Returns the value of attribute method.
3 4 5 |
# File 'lib/googlecalendar/calendar.rb', line 3 def method @method end |
#product_id ⇒ Object
Returns the value of attribute product_id.
3 4 5 |
# File 'lib/googlecalendar/calendar.rb', line 3 def product_id @product_id end |
#scale ⇒ Object
Returns the value of attribute scale.
3 4 5 |
# File 'lib/googlecalendar/calendar.rb', line 3 def scale @scale end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/googlecalendar/calendar.rb', line 3 def version @version end |
Instance Method Details
#add(event) ⇒ Object
5 6 7 8 9 |
# File 'lib/googlecalendar/calendar.rb', line 5 def add(event) # create events if it doesn't exist @events ||= [] @events.push event end |
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/googlecalendar/calendar.rb', line 11 def to_s data = "########## calendar ##########\n" data << 'version: ' + @version.to_s + "\n" data << 'scale: ' + @scale.to_s + "\n" data << 'method: ' + @method.to_s + "\n" data << 'number of events: ' + @events.size.to_s + "\n" @events.each do |event| data << event.to_s end return data end |