Class: GCal4Ruby::Event
- Inherits:
-
Object
- Object
- GCal4Ruby::Event
- Defined in:
- lib/outlook2gcal/gcal4ruby_gateway.rb
Instance Method Summary collapse
- #all_day=(is_all_day) ⇒ Object
- #convert_to_time(t) ⇒ Object
-
#end_time ⇒ Object
see end_time=().
-
#end_time=(t) ⇒ Object
The event end date and time For all_day-events it is the day, when the event ends (and not the day after as in the google api).
- #end_time_orig ⇒ Object
-
#end_time_orig= ⇒ Object
alias :start_time= :start= alias :start_time :start.
Instance Method Details
#all_day=(is_all_day) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 23 def all_day=(is_all_day) if self.end_time_orig and !(is_all_day == @all_day) # Not necessary in Outlook (was/is a Lotus Notes issue)!! # is_all_day ? self.end_time_orig=(self.end_time_orig()+DAY_SECS) : self.end_time_orig=(self.end_time_orig-DAY_SECS) end @all_day = is_all_day end |
#convert_to_time(t) ⇒ Object
54 55 56 57 58 59 60 61 62 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 54 def convert_to_time(t) if t.is_a?String return Time.parse(t) elsif t.is_a?Time return t else raise "Time must be either Time or String" end end |
#end_time ⇒ Object
see end_time=()
46 47 48 49 50 51 52 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 46 def end_time # if @all_day # return (self.end_time_orig-DAY_SECS) # else return self.end_time_orig() # end end |
#end_time=(t) ⇒ Object
The event end date and time For all_day-events it is the day, when the event ends (and not the day after as in the google api)
36 37 38 39 40 41 42 43 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 36 def end_time=(t) tc = convert_to_time(t) # if @all_day # self.end_time_orig = tc + DAY_SECS # else self.end_time_orig = tc # end end |
#end_time_orig ⇒ Object
21 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 21 alias :end_time_orig :end_time |
#end_time_orig= ⇒ Object
alias :start_time= :start= alias :start_time :start
20 |
# File 'lib/outlook2gcal/gcal4ruby_gateway.rb', line 20 alias :end_time_orig= :end_time= |