Class: ArrowFormat::TimeType
- Inherits:
-
TemporalType
- Object
- Type
- PrimitiveType
- TemporalType
- ArrowFormat::TimeType
- Defined in:
- lib/arrow-format/type.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bit_width ⇒ Object
readonly
Returns the value of attribute bit_width.
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
-
#initialize(bit_width, unit) ⇒ TimeType
constructor
A new instance of TimeType.
- #to_flatbuffers ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(bit_width, unit) ⇒ TimeType
Returns a new instance of TimeType.
412 413 414 415 416 |
# File 'lib/arrow-format/type.rb', line 412 def initialize(bit_width, unit) super() @bit_width = bit_width @unit = unit end |
Instance Attribute Details
#bit_width ⇒ Object (readonly)
Returns the value of attribute bit_width.
410 411 412 |
# File 'lib/arrow-format/type.rb', line 410 def bit_width @bit_width end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
411 412 413 |
# File 'lib/arrow-format/type.rb', line 411 def unit @unit end |
Instance Method Details
#to_flatbuffers ⇒ Object
422 423 424 425 426 427 |
# File 'lib/arrow-format/type.rb', line 422 def to_flatbuffers fb_type = FB::Time::Data.new fb_type.bit_width = @bit_width fb_type.unit = FB::TimeUnit.try_convert(@unit.to_s.upcase) fb_type end |
#to_s ⇒ Object
418 419 420 |
# File 'lib/arrow-format/type.rb', line 418 def to_s "#{super}(#{unit})" end |