Class: Googlecalendar::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_nameObject

Returns the value of attribute class_name.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def class_name
  @class_name
end

#createdObject

Returns the value of attribute created.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def created
  @created
end

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def description
  @description
end

#end_dateObject

Returns the value of attribute end_date.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def end_date
  @end_date
end

#last_modifiedObject

Returns the value of attribute last_modified.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def last_modified
  @last_modified
end

#locationObject

Returns the value of attribute location.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def location
  @location
end

#rruleObject

Returns the value of attribute rrule.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def rrule
  @rrule
end

#start_dateObject

Returns the value of attribute start_date.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def start_date
  @start_date
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def status
  @status
end

#summaryObject

Returns the value of attribute summary.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def summary
  @summary
end

#time_stampObject

Returns the value of attribute time_stamp.



3
4
5
# File 'lib/googlecalendar/event.rb', line 3

def time_stamp
  @time_stamp
end

Instance Method Details

#rrule_as_hashObject

‘FREQ=WEEKLY;BYDAY=MO;WKST=MO’



22
23
24
25
26
27
28
29
30
# File 'lib/googlecalendar/event.rb', line 22

def rrule_as_hash
  array = @rrule.split(';')
  hash = Hash.new
  array.each do |item| 
    pair = item.split('=')
    hash[pair[0]] = pair[1]
  end 
  return hash
end

#to_sObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/googlecalendar/event.rb', line 5

def to_s
  data = "---------- event ----------\n"
  data << 'start_date: ' + @start_date.to_s + "\n"
  data << 'end_date: ' + @end_date.to_s + "\n"
  data << 'time_stamp: ' + @time_stamp.to_s + "\n"
  data << 'class_name: ' + @class_name.to_s + "\n"
  data << 'created: ' + @created.to_s + "\n"
  data << 'last_modified: ' + @last_modified.to_s + "\n"
  data << 'status: ' + @status.to_s + "\n"
  data << 'rrule: ' + @rrule.to_s + "\n"
  data << 'summary: ' + @summary.to_s + "\n"
  data << 'desription: ' + @desription.to_s + "\n"
  data << 'location: ' + @location.to_s + "\n"
  return data
end