I used to have this method:
def send_action(action, &success_block)
end
Which I could call like this:
send_action('PAIR') do
pp 'test
end
Now I want to add an optional parameter:
def send_action(action, uuid = nil, &success_block)
end
But that doesn't seem to work (which I though). So I tried writing it with named parameters:
def send_action(action:, uuid: nil, &success_block)
end
But how can I combine named parameters with a block?
def send_action(action, uuid = nil, &success_block)Works For Me™. What error are you seeing? And what version of Ruby are you using?