Class: Boolean

Inherits:
Object show all
Defined in:
opal/stdlib/json.rb,
opal/stdlib/native.rb

Instance Method Summary collapse

Instance Method Details

#to_jsonObject



148
149
150
# File 'opal/stdlib/json.rb', line 148

def to_json
  `(self == true) ? 'true' : 'false'`
end

#to_nObject

Returns the internal JavaScript value (with valueOf).

Returns:

  • the internal JavaScript value (with valueOf).



513
514
515
# File 'opal/stdlib/native.rb', line 513

def to_n
  `self.valueOf()`
end