lib/code/node/boolean.rb in code-ruby-0.10.4 vs lib/code/node/boolean.rb in code-ruby-0.11.0

- old
+ new

@@ -5,19 +5,20 @@ class Boolean < Node TRUE_KEYWORD = "true" FALSE_KEYWORD = "false" def initialize(parsed) - @boolean = parsed + return if parsed.blank? + @boolean = parsed.presence end def evaluate(**_args) if @boolean == TRUE_KEYWORD - ::Code::Object::Boolean.new(true) + Object::Boolean.new(true) elsif @boolean == FALSE_KEYWORD - ::Code::Object::Boolean.new(false) + Object::Boolean.new(false) else - raise NotImplementedError, @boolean + Object::Nothing.new end end end end end