Invalid function in ruby
Why is this function invalid? def request(method='get',resource, meta={}, strip=true) end unexcpected ')' expecting keyword_end Thank you! In Ruby, you can't surround a required parameter with optional parameters. Using def request(resource, method='get', strip=true, meta={}) end will solve the issue. As a thought experiment, consider the original function def request(method='get',resource, meta={}, strip=true) end If I call that method as request(object) , the desired behavior is fairly obvious -- call the method with object as the resource parameter. But what if I call it as request('post',