Class: BigDecimal

Inherits:
Object show all
Defined in:
lib/core_ext/big_decimal.rb

Overview

Reopen the core BigDecimal class to represent #inspect_lit.

Instance Method Summary collapse

Instance Method Details

#inspect_litString

Formats this BigDecimal as an object-type-revealing String.

Examples:

BigDecimal.new(1).inspect_lit          # => "<BD:1.0>"
BigDecimal.new(99.999, 5).inspect_lit  # => "<BD:99.999>"

12
13
14
# File 'lib/core_ext/big_decimal.rb', line 12

def inspect_lit
  "<BD:#{self}>"
end