Class: Icalendar::Offset
- Inherits:
-
Object
- Object
- Icalendar::Offset
- Defined in:
- lib/icalendar/offset.rb,
lib/icalendar/offset/null.rb,
lib/icalendar/offset/time_zone_store.rb,
lib/icalendar/offset/windows_to_iana.rb,
lib/icalendar/offset/active_support_exact.rb,
lib/icalendar/offset/active_support_partial.rb
Direct Known Subclasses
ActiveSupportExact, ActiveSupportPartial, Null, TimeZoneStore, WindowsToIana
Defined Under Namespace
Classes: ActiveSupportExact, ActiveSupportPartial, Null, TimeZoneStore, WindowsToIana
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tzid, value, timezone_store) ⇒ Offset
constructor
A new instance of Offset.
- #normalized_tzid ⇒ Object
Constructor Details
#initialize(tzid, value, timezone_store) ⇒ Offset
Returns a new instance of Offset.
19 20 21 22 23 |
# File 'lib/icalendar/offset.rb', line 19 def initialize(tzid, value, timezone_store) @tzid = tzid @value = value @timezone_store = timezone_store end |
Class Method Details
.build(value, params, timezone_store) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/icalendar/offset.rb', line 5 def self.build(value, params, timezone_store) return nil if params.nil? || params['tzid'].nil? tzid = Array(params['tzid']).first [ Icalendar::Offset::ActiveSupportExact, Icalendar::Offset::TimeZoneStore, Icalendar::Offset::WindowsToIana, Icalendar::Offset::ActiveSupportPartial, Icalendar::Offset::Null ].lazy.map { |klass| klass.new(tzid, value, timezone_store) }.detect(&:valid?) end |
Instance Method Details
#normalized_tzid ⇒ Object
25 26 27 |
# File 'lib/icalendar/offset.rb', line 25 def normalized_tzid Array(tzid) end |