Module: Trxl::SplitFunction1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



5498
5499
5500
5501
5502
5503
5504
5505
# File 'lib/trxl/trxl_grammar.rb', line 5498

def eval(env = Environment.new)
  string, char = split_string.eval(env), split_char.eval(env)
  if string.is_a?(String) && char.is_a?(String)
    string.split(char)
  else
    raise Trxl::InvalidArgumentException, "Both arguments must be of type String"
  end
end