class Tildeath::ASTNodes::Bifurcate
Public Class Methods
new(orig, parts)
click to toggle source
# File lib/tildeath/ast_nodes/bifurcate.rb, line 6 def initialize(orig, parts) @orig = orig @parts = parts end
Public Instance Methods
execute(context)
click to toggle source
# File lib/tildeath/ast_nodes/bifurcate.rb, line 11 def execute(context) type = context[@orig].type @parts.each do |part| context[part] = ImminentlyDeceasedObject.new(type, part) end end
to_s()
click to toggle source
# File lib/tildeath/ast_nodes/bifurcate.rb, line 18 def to_s @parts[1..-1].reduce("bifurcate #{@orig}[#{@parts[0]}") {|memo, part| memo << ', ' << part.to_s } << ']' end