I have the following code that as far as I know should work correctly but doesn't:
def calculate( *nums, options = {} ) //errors out here on equals sign
if options.empty
return add(nums)
elsif options[:subtract]
return substract(nums)
elsif options[:add]
return add(nums)
end
end
Error:
class: SyntaxError message: /opt/eval-server/eval-server/app/models/eval_spec_runner.rb:5: syntax error, unexpected '=', expecting ')' def calculate( *nums, options = {} ) ^ backtrace: RubyMonk:18:in `eval'