Class: WaffleCal::Event
- Inherits:
-
Object
- Object
- WaffleCal::Event
- Defined in:
- lib/waffle_cal/event.rb
Constant Summary collapse
- @@time_format =
"%Y%m%dT%H%M00"
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#end_time ⇒ Object
Returns the value of attribute end_time.
-
#location ⇒ Object
Returns the value of attribute location.
-
#start_time ⇒ Object
Returns the value of attribute start_time.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Event
constructor
A new instance of Event.
- #to_s ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Event
Returns a new instance of Event.
9 10 11 |
# File 'lib/waffle_cal/event.rb', line 9 def initialize(attrs={}) attrs.each { |key, val| self.send("#{key}=", val) } end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def description @description end |
#end_time ⇒ Object
Returns the value of attribute end_time.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def end_time @end_time end |
#location ⇒ Object
Returns the value of attribute location.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def location @location end |
#start_time ⇒ Object
Returns the value of attribute start_time.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def start_time @start_time end |
#summary ⇒ Object
Returns the value of attribute summary.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def summary @summary end |
#uid ⇒ Object
Returns the value of attribute uid.
5 6 7 |
# File 'lib/waffle_cal/event.rb', line 5 def uid @uid end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/waffle_cal/event.rb', line 13 def to_s valid? output = [] output << start_event output << date_start_str output << date_end_str output << uid_str output << summary_str if summary output << location_str if location output << description_str if description output << end_event output.join("\r\n") end |