Class: Code::Node::Base2
- Inherits:
-
Code::Node
- Object
- Code::Node
- Code::Node::Base2
- Defined in:
- lib/code/node/base_2.rb
Instance Method Summary collapse
- #evaluate(**_args) ⇒ Object
-
#initialize(parsed) ⇒ Base2
constructor
A new instance of Base2.
Methods inherited from Code::Node
Constructor Details
#initialize(parsed) ⇒ Base2
Returns a new instance of Base2.
6 7 8 9 10 |
# File 'lib/code/node/base_2.rb', line 6 def initialize(parsed) return if parsed.blank? @base_2 = parsed.presence end |
Instance Method Details
#evaluate(**_args) ⇒ Object
12 13 14 |
# File 'lib/code/node/base_2.rb', line 12 def evaluate(**_args) @base_2 ? Object::Integer.new(@base_2.to_i(2)) : Object::Nothing.new end |