Class: Icalendar::Values::Time
- Inherits:
-
Icalendar::Value
- Object
- SimpleDelegator
- Icalendar::Value
- Icalendar::Values::Time
- Includes:
- TimeWithZone
- Defined in:
- lib/icalendar/values/time.rb
Constant Summary collapse
- FORMAT =
'%H%M%S'
Instance Attribute Summary
Attributes included from TimeWithZone
Attributes inherited from Icalendar::Value
Instance Method Summary collapse
-
#initialize(value, params = {}) ⇒ Time
constructor
A new instance of Time.
- #value_ical ⇒ Object
Methods included from TimeWithZone
Methods inherited from Icalendar::Value
#ical_param, #params_ical, #to_ical, #value, value_type, #value_type
Constructor Details
#initialize(value, params = {}) ⇒ Time
Returns a new instance of Time.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/icalendar/values/time.rb', line 12 def initialize(value, params = {}) if value.is_a? String params['tzid'] = 'UTC' if value.end_with? 'Z' super ::DateTime.strptime(value, FORMAT).to_time, params elsif value.respond_to? :to_time super value.to_time, params else super end end |