def create_node(id = retrieve_lb_id, addr, port)
return if check_node_exists(id, addr, port)
begin
<do something>
rescue <various errors>
<log some stuff>
end
end
Perhaps you could abstract that out into its own method that accepts a block, and then just pass the various specifics into the more generic method. You'd do this under the hood, still having the end users see the nice method names, but underneath, you'd really have very simple logic.
This pattern happens a lot in the library:
Perhaps you could abstract that out into its own method that accepts a block, and then just pass the various specifics into the more generic method. You'd do this under the hood, still having the end users see the nice method names, but underneath, you'd really have very simple logic.