Class: NilClass

Inherits:
Object
  • Object
show all
Defined in:
lib/bigdecimal/util.rb

Instance Method Summary collapse

Instance Method Details

#to_dObject

call-seq:

nil.to_d -> bigdecimal

Returns nil represented as a BigDecimal.

require 'bigdecimal'
require 'bigdecimal/util'

nil.to_d   # => 0.0


143
144
145
# File 'lib/bigdecimal/util.rb', line 143

def to_d
  BigDecimal(0)
end