Class: RiCal::Component::Calendar::TZInfoWrapper
- Defined in:
- lib/ri_cal/component/calendar.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#calendar ⇒ Object
readonly
:nodoc:.
-
#tzinfo ⇒ Object
readonly
:nodoc:.
Instance Method Summary collapse
-
#date_time(ruby_time, tzid) ⇒ Object
:nodoc:.
-
#identifier ⇒ Object
:nodoc:.
-
#initialize(tzinfo, calendar) ⇒ TZInfoWrapper
constructor
:nodoc:.
-
#local_to_utc(utc) ⇒ Object
:nodoc:.
-
#utc_to_local(local) ⇒ Object
:nodoc:.
Constructor Details
#initialize(tzinfo, calendar) ⇒ TZInfoWrapper
:nodoc:
106 107 108 109 |
# File 'lib/ri_cal/component/calendar.rb', line 106 def initialize(tzinfo, calendar) #:nodoc: @tzinfo = tzinfo @calendar = calendar end |
Instance Attribute Details
#calendar ⇒ Object (readonly)
:nodoc:
105 106 107 |
# File 'lib/ri_cal/component/calendar.rb', line 105 def calendar @calendar end |
#tzinfo ⇒ Object (readonly)
:nodoc:
105 106 107 |
# File 'lib/ri_cal/component/calendar.rb', line 105 def tzinfo @tzinfo end |
Instance Method Details
#date_time(ruby_time, tzid) ⇒ Object
:nodoc:
115 116 117 |
# File 'lib/ri_cal/component/calendar.rb', line 115 def date_time(ruby_time, tzid) #:nodoc: RiCal::PropertyValue::DateTime.new(calendar, :value => ruby_time, :params => {'TZID' => tzid}) end |
#identifier ⇒ Object
:nodoc:
111 112 113 |
# File 'lib/ri_cal/component/calendar.rb', line 111 def identifier #:nodoc: tzinfo.identifier end |
#local_to_utc(utc) ⇒ Object
:nodoc:
119 120 121 |
# File 'lib/ri_cal/component/calendar.rb', line 119 def local_to_utc(utc) #:nodoc: date_time(tzinfo.local_to_utc(utc.to_ri_cal_ruby_value), 'UTC') end |
#utc_to_local(local) ⇒ Object
:nodoc:
123 124 125 |
# File 'lib/ri_cal/component/calendar.rb', line 123 def utc_to_local(local) #:nodoc: date_time(tzinfo.utc_to_local(local.to_ri_cal_ruby_value), tzinfo.identifier) end |