Class: ArrowFormat::DurationType
- Inherits:
-
TemporalType
- Object
- Type
- PrimitiveType
- TemporalType
- ArrowFormat::DurationType
- Defined in:
- lib/arrow-format/type.rb
Instance Attribute Summary collapse
-
#unit ⇒ Object
readonly
Returns the value of attribute unit.
Instance Method Summary collapse
- #buffer_type ⇒ Object
- #build_array(size, validity_buffer, values_buffer) ⇒ Object
-
#initialize(unit) ⇒ DurationType
constructor
A new instance of DurationType.
- #name ⇒ Object
- #to_flatbuffers ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(unit) ⇒ DurationType
Returns a new instance of DurationType.
580 581 582 583 |
# File 'lib/arrow-format/type.rb', line 580 def initialize(unit) super() @unit = unit end |
Instance Attribute Details
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
579 580 581 |
# File 'lib/arrow-format/type.rb', line 579 def unit @unit end |
Instance Method Details
#buffer_type ⇒ Object
589 590 591 |
# File 'lib/arrow-format/type.rb', line 589 def buffer_type :s64 end |
#build_array(size, validity_buffer, values_buffer) ⇒ Object
593 594 595 |
# File 'lib/arrow-format/type.rb', line 593 def build_array(size, validity_buffer, values_buffer) DurationArray.new(self, size, validity_buffer, values_buffer) end |
#name ⇒ Object
585 586 587 |
# File 'lib/arrow-format/type.rb', line 585 def name "Duration" end |
#to_flatbuffers ⇒ Object
601 602 603 604 605 |
# File 'lib/arrow-format/type.rb', line 601 def to_flatbuffers fb_type = FB::Duration::Data.new fb_type.unit = FB::TimeUnit.try_convert(@unit.to_s.upcase) fb_type end |
#to_s ⇒ Object
597 598 599 |
# File 'lib/arrow-format/type.rb', line 597 def to_s "#{super}(#{@unit})" end |