Class: Odin::Types::OdinTime
- Defined in:
- lib/odin/types/values.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from OdinValue
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(value, **kwargs) ⇒ OdinTime
constructor
A new instance of OdinTime.
- #to_s ⇒ Object
- #type ⇒ Object
- #with_directives(dirs) ⇒ Object
- #with_modifiers(mods) ⇒ Object
Methods inherited from OdinValue
#array?, #binary?, #boolean?, #confidential?, #currency?, #date?, #deprecated?, #duration?, #integer?, #null?, #number?, #numeric?, #object?, #percent?, #reference?, #required?, #string?, #temporal?, #time?, #timestamp?, #verb?
Constructor Details
#initialize(value, **kwargs) ⇒ OdinTime
Returns a new instance of OdinTime.
363 364 365 366 367 |
# File 'lib/odin/types/values.rb', line 363 def initialize(value, **kwargs) super(**kwargs) @value = -value.to_s freeze end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
361 362 363 |
# File 'lib/odin/types/values.rb', line 361 def value @value end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
371 372 373 |
# File 'lib/odin/types/values.rb', line 371 def ==(other) other.is_a?(OdinTime) && value == other.value end |
#hash ⇒ Object
376 377 378 |
# File 'lib/odin/types/values.rb', line 376 def hash [ValueType::TIME, value].hash end |
#to_s ⇒ Object
380 381 382 |
# File 'lib/odin/types/values.rb', line 380 def to_s value end |