Class: ArrowFormat::DecimalType
- Inherits:
-
FixedSizeBinaryType
- Object
- Type
- FixedSizeBinaryType
- ArrowFormat::DecimalType
- Defined in:
- lib/arrow-format/type.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#precision ⇒ Object
readonly
Returns the value of attribute precision.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
Attributes inherited from FixedSizeBinaryType
Instance Method Summary collapse
-
#initialize(byte_width, precision, scale) ⇒ DecimalType
constructor
A new instance of DecimalType.
- #to_flatbuffers ⇒ Object
- #to_s ⇒ Object
Methods inherited from FixedSizeBinaryType
Constructor Details
#initialize(byte_width, precision, scale) ⇒ DecimalType
Returns a new instance of DecimalType.
761 762 763 764 765 |
# File 'lib/arrow-format/type.rb', line 761 def initialize(byte_width, precision, scale) super(byte_width) @precision = precision @scale = scale end |
Instance Attribute Details
#precision ⇒ Object (readonly)
Returns the value of attribute precision.
759 760 761 |
# File 'lib/arrow-format/type.rb', line 759 def precision @precision end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
760 761 762 |
# File 'lib/arrow-format/type.rb', line 760 def scale @scale end |
Instance Method Details
#to_flatbuffers ⇒ Object
771 772 773 774 775 776 777 |
# File 'lib/arrow-format/type.rb', line 771 def to_flatbuffers fb_type = FB::Decimal::Data.new fb_type.bit_width = @byte_width * 8 fb_type.precision = @precision fb_type.scale = @scale fb_type end |
#to_s ⇒ Object
767 768 769 |
# File 'lib/arrow-format/type.rb', line 767 def to_s "#{name}(#{@precision}, #{@scale})" end |