Module: Trxl::SplitFunction1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



5704
5705
5706
5707
5708
5709
5710
5711
# File 'lib/trxl/trxl_grammar.rb', line 5704

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