Class: Code::Node::Base8

Inherits:
Code::Node show all
Defined in:
lib/code/node/base_8.rb

Instance Method Summary collapse

Methods inherited from Code::Node

#resolve

Constructor Details

#initialize(parsed) ⇒ Base8

Returns a new instance of Base8.



6
7
8
9
10
# File 'lib/code/node/base_8.rb', line 6

def initialize(parsed)
  return if parsed.blank?

  @base_8 = parsed.presence
end

Instance Method Details

#evaluate(**_args) ⇒ Object



12
13
14
# File 'lib/code/node/base_8.rb', line 12

def evaluate(**_args)
  @base_8 ? Object::Integer.new(@base_8.to_i(8)) : Object::Nothing.new
end