Class: BigDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/active_support/json/encoding/active_support_encoder.rb

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Object

:nodoc:



153
154
155
156
157
158
159
# File 'lib/active_support/json/encoding/active_support_encoder.rb', line 153

def as_json(options = nil) #:nodoc:
  if finite?
    ActiveSupport.encode_big_decimal_as_string ? to_s : self
  else
    nil
  end
end

#encode_json(encoder) ⇒ Object

:nodoc:



161
162
163
# File 'lib/active_support/json/encoding/active_support_encoder.rb', line 161

def encode_json(encoder) #:nodoc:
  to_s
end