Class: Iceberg::DecimalType

Inherits:
PrimitiveType show all
Defined in:
lib/iceberg/types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(precision, scale) ⇒ DecimalType

Returns a new instance of DecimalType.



32
33
34
35
# File 'lib/iceberg/types.rb', line 32

def initialize(precision, scale)
  @precision = precision
  @scale = scale
end

Instance Attribute Details

#precisionObject (readonly)

Returns the value of attribute precision.



30
31
32
# File 'lib/iceberg/types.rb', line 30

def precision
  @precision
end

#scaleObject (readonly)

Returns the value of attribute scale.



30
31
32
# File 'lib/iceberg/types.rb', line 30

def scale
  @scale
end

Instance Method Details

#==(other) ⇒ Object



37
38
39
# File 'lib/iceberg/types.rb', line 37

def ==(other)
  other.is_a?(self.class) && other.precision == @precision && other.scale == @scale
end

#inspectObject



41
42
43
# File 'lib/iceberg/types.rb', line 41

def inspect
  "#<#{self.class.name} precision=#{@precision.inspect}, scale=#{@scale.inspect}>"
end