Class: RBelly::JS::Boolean
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Boolean
constructor
A new instance of Boolean.
Methods inherited from Base
#[], #[]=, #can_put?, #default_value, #delete, #has_property?, #returned?
Constructor Details
#initialize(*args) ⇒ Boolean
Returns a new instance of Boolean.
10 11 12 13 14 15 16 17 18 |
# File 'lib/rbelly/js/boolean.rb', line 10 def initialize(*args) super() value = args.first.nil? ? false : args.first self['valueOf'] = value self['valueOf'].function = lambda { value } self['toString'] = args.first.to_s end |
Class Method Details
.create(*args) ⇒ Object
5 6 7 8 |
# File 'lib/rbelly/js/boolean.rb', line 5 def create(*args) return false if args.length == 0 self.new(args.first) end |