Class: Arrow::Decimal128
- Inherits:
-
Object
- Object
- Arrow::Decimal128
- Defined in:
- lib/arrow/decimal128.rb
Class Method Summary collapse
- .try_convert(value) ⇒ Object private
Instance Method Summary collapse
- #abs ⇒ Object
- #abs! ⇒ Object
- #negate ⇒ Object
- #negate! ⇒ Object
- #to_s(scale = nil) ⇒ Object
- #to_s_raw ⇒ Object
Class Method Details
.try_convert(value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/arrow/decimal128.rb', line 22 def try_convert(value) case value when String new(value) when Float new(value.to_s) else nil end end |
Instance Method Details
#abs ⇒ Object
59 60 61 62 63 |
# File 'lib/arrow/decimal128.rb', line 59 def abs copied = dup copied.abs! copied end |
#abs! ⇒ Object
56 |
# File 'lib/arrow/decimal128.rb', line 56 alias_method :abs!, :abs |
#negate ⇒ Object
68 69 70 71 72 |
# File 'lib/arrow/decimal128.rb', line 68 def negate copied = dup copied.negate! copied end |
#negate! ⇒ Object
65 |
# File 'lib/arrow/decimal128.rb', line 65 alias_method :negate!, :negate |
#to_s ⇒ String #to_s(scale) ⇒ String
48 49 50 51 52 53 54 |
# File 'lib/arrow/decimal128.rb', line 48 def to_s(scale=nil) if scale to_string_scale(scale) else to_s_raw end end |
#to_s_raw ⇒ Object
34 |
# File 'lib/arrow/decimal128.rb', line 34 alias_method :to_s_raw, :to_s |