Class: Code::Node::Base16

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

Instance Method Summary collapse

Methods inherited from Code::Node

#resolve

Constructor Details

#initialize(parsed) ⇒ Base16

Returns a new instance of Base16.



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

def initialize(parsed)
  return if parsed.blank?

  @base_16 = parsed.presence
end

Instance Method Details

#evaluate(**_args) ⇒ Object



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

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