Class: ArrowFormat::TimestampType
- Inherits:
-
TemporalType
- Object
- Type
- PrimitiveType
- TemporalType
- ArrowFormat::TimestampType
- Defined in:
- lib/arrow-format/type.rb
Instance Attribute Summary collapse
-
#time_zone ⇒ Object
readonly
Returns the value of attribute time_zone.
-
#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, time_zone) ⇒ TimestampType
constructor
A new instance of TimestampType.
- #name ⇒ Object
- #to_flatbuffers ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(unit, time_zone) ⇒ TimestampType
Returns a new instance of TimestampType.
469 470 471 472 473 |
# File 'lib/arrow-format/type.rb', line 469 def initialize(unit, time_zone) super() @unit = unit @time_zone = time_zone end |
Instance Attribute Details
#time_zone ⇒ Object (readonly)
Returns the value of attribute time_zone.
468 469 470 |
# File 'lib/arrow-format/type.rb', line 468 def time_zone @time_zone end |
#unit ⇒ Object (readonly)
Returns the value of attribute unit.
467 468 469 |
# File 'lib/arrow-format/type.rb', line 467 def unit @unit end |
Instance Method Details
#buffer_type ⇒ Object
479 480 481 |
# File 'lib/arrow-format/type.rb', line 479 def buffer_type :s64 end |
#build_array(size, validity_buffer, values_buffer) ⇒ Object
483 484 485 |
# File 'lib/arrow-format/type.rb', line 483 def build_array(size, validity_buffer, values_buffer) TimestampArray.new(self, size, validity_buffer, values_buffer) end |
#name ⇒ Object
475 476 477 |
# File 'lib/arrow-format/type.rb', line 475 def name "Timestamp" end |
#to_flatbuffers ⇒ Object
493 494 495 496 497 498 |
# File 'lib/arrow-format/type.rb', line 493 def to_flatbuffers fb_type = FB::Timestamp::Data.new fb_type.unit = FB::TimeUnit.try_convert(@unit.to_s.upcase) fb_type.timezone = @time_zone fb_type end |
#to_s ⇒ Object
487 488 489 490 491 |
# File 'lib/arrow-format/type.rb', line 487 def to_s = [@unit] << @time_zone if @time_zone "#{super}(#{.join(", ")})" end |