class Tildeath::ASTNodes::Split

Public Class Methods

new(orig, parts) click to toggle source
# File lib/tildeath/ast_nodes/split.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/split.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/split.rb, line 18
def to_s
  @parts[1..-1].reduce("split #{@orig}[#{@parts[0]}") {|memo, part|
    memo << ', ' << part.to_s
  } << ']'
end