Module: Trxl::SizeFunction1

Defined in:
lib/trxl/trxl_grammar.rb

Instance Method Summary collapse

Instance Method Details

#eval(env = Environment.new) ⇒ Object



5592
5593
5594
5595
5596
5597
5598
5599
# File 'lib/trxl/trxl_grammar.rb', line 5592

def eval(env = Environment.new)
  result = expression.eval(env)
  if result.respond_to?(:length)
    result.length
  else
    raise Trxl::InvalidOperationException, "Argument is not Enumerable"
  end
end