Class: Cronofy::EventTime
- Inherits:
-
Object
- Object
- Cronofy::EventTime
- Defined in:
- lib/cronofy/types.rb
Instance Attribute Summary collapse
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#tzid ⇒ Object
readonly
Returns the value of attribute tzid.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(time, tzid) ⇒ EventTime
constructor
A new instance of EventTime.
Constructor Details
#initialize(time, tzid) ⇒ EventTime
Returns a new instance of EventTime.
257 258 259 260 |
# File 'lib/cronofy/types.rb', line 257 def initialize(time, tzid) @time = time @tzid = tzid end |
Instance Attribute Details
#time ⇒ Object (readonly)
Returns the value of attribute time.
254 255 256 |
# File 'lib/cronofy/types.rb', line 254 def time @time end |
#tzid ⇒ Object (readonly)
Returns the value of attribute tzid.
255 256 257 |
# File 'lib/cronofy/types.rb', line 255 def tzid @tzid end |
Class Method Details
.coerce(value) ⇒ Object
262 263 264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/cronofy/types.rb', line 262 def self.coerce(value) case value when String DateOrTime.coerce(value) when Hash time_value = value["time"] tzid = value["tzid"] date_or_time = DateOrTime.coerce(time_value) new(date_or_time, tzid) end end |
Instance Method Details
#==(other) ⇒ Object
276 277 278 279 280 281 282 283 |
# File 'lib/cronofy/types.rb', line 276 def ==(other) case other when EventTime self.time == other.time && self.tzid == other.tzid else false end end |