Module: Trxl::SplitFunction1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



5699
5700
5701
5702
5703
5704
5705
5706
# File 'lib/trxl/trxl_grammar.rb', line 5699

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