Class: BigDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/twobook/number_handling.rb

Instance Method Summary collapse

Instance Method Details

#as_json(*_) ⇒ Object



9
10
11
# File 'lib/twobook/number_handling.rb', line 9

def as_json(*_)
  truncate(Twobook::SCALE).to_f
end

#inspectObject

Makes it easier to work with these in a repl



5
6
7
# File 'lib/twobook/number_handling.rb', line 5

def inspect
  "#<BigDecimal '#{to_f}'>"
end