Class: NilClass
- Defined in:
- opal/stdlib/json.rb,
opal/stdlib/native.rb,
opal/stdlib/bigdecimal/util.rb
Instance Method Summary collapse
-
#to_d ⇒ Object
call-seq: nil.to_d -> bigdecimal.
- #to_json ⇒ Object
-
#to_n ⇒ Object
The corresponding JavaScript value (
null
).
Instance Method Details
#to_d ⇒ Object
call-seq: nil.to_d -> bigdecimal
Returns nil represented as a BigDecimal.
require 'bigdecimal'
require 'bigdecimal/util'
nil.to_d # => 0.0
146 147 148 |
# File 'opal/stdlib/bigdecimal/util.rb', line 146 def to_d BigDecimal(0) end |
#to_json ⇒ Object
171 172 173 |
# File 'opal/stdlib/json.rb', line 171 def to_json 'null' end |
#to_n ⇒ Object
Returns the corresponding JavaScript value (null
).
529 530 531 |
# File 'opal/stdlib/native.rb', line 529 def to_n `null` end |