Class: WaffleCal::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/waffle_cal/event.rb

Constant Summary collapse

@@time_format =
"%Y%m%dT%H%M00"

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'lib/waffle_cal/event.rb', line 5

def description
  @description
end

#end_timeObject

Returns the value of attribute end_time.



5
6
7
# File 'lib/waffle_cal/event.rb', line 5

def end_time
  @end_time
end

#locationObject

Returns the value of attribute location.



5
6
7
# File 'lib/waffle_cal/event.rb', line 5

def location
  @location
end

#start_timeObject

Returns the value of attribute start_time.



5
6
7
# File 'lib/waffle_cal/event.rb', line 5

def start_time
  @start_time
end

#summaryObject

Returns the value of attribute summary.



5
6
7
# File 'lib/waffle_cal/event.rb', line 5

def summary
  @summary
end

#uidObject

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_sObject



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