Ruby method only use second optional parameter

I have a method:

def my_method(id,raise_error=true,validate=false)

How can I call this method with only using the second optional parameter?

I tried:


Would it be better here to use an options hash?

Source: ruby

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.