Returns true
if mod is a singleton class or false
if it is an ordinary class or module.
class C end C.singleton_class? #=> false C.singleton_class.singleton_class? #=> true
Execute the provided block, but preserve the precision limit
BigDecimal.limit(100) puts BigDecimal.limit BigDecimal.save_limit do BigDecimal.limit(200) puts BigDecimal.limit end puts BigDecimal.limit
Converts a BigDecimal
to a String
of the form “nnnnnn.mmm”. This method is deprecated; use BigDecimal#to_s
(“F”) instead.
require 'bigdecimal/util' d = BigDecimal("3.14") d.to_digits # => "3.14"
return the JSON
value
Deserializes JSON
string by converting numerator value n
, denominator value d
, to a Rational
object.
Returns a hash, that will be turned into a JSON
object and represent this object.
Return the accept character set for all new CGI
instances.
This method is equivalent to d >> (n * 12).
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...> Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...> Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
See also Date#>>
.
This method is equivalent to d << (n * 12).
Date.new(2001,2,3).prev_year #=> #<Date: 2000-02-03 ...> Date.new(2008,2,29).prev_year #=> #<Date: 2007-02-28 ...> Date.new(2008,2,29).prev_year(4) #=> #<Date: 2004-02-29 ...>
See also Date#<<
.
Deserializes JSON
string by converting Julian year y
, month m
, day d
and Day of Calendar Reform sg
to Date
.
Returns a hash, that will be turned into a JSON
object and represent this object.
Stores class name (Date
) with Julian year y
, month m
, day d
and Day of Calendar Reform sg
as JSON
string
Deserializes JSON
string by converting year y
, month m
, day d
, hour H
, minute M
, second S
, offset of
and Day of Calendar Reform sg
to DateTime
.
Returns a hash, that will be turned into a JSON
object and represent this object.
Stores class name (DateTime
) with Julian year y
, month m
, day d
, hour H
, minute M
, second S
, offset of
and Day of Calendar Reform sg
as JSON
string
Returns a hash, that will be turned into a JSON
object and represent this object.
Stores class name (Time
) with number of seconds since epoch and number of microseconds for Time
as JSON
string