Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def state
if not collected?
'booked'
elsif not ironed?
'collected'
elsif not delivered?
'ironed'
else
'delivered'
end
end
# ironed? might raise an exception if collected? is false
# delivered? might raise an exception if ironed? is false
STATES = ['booked', 'collected', 'ironed', 'delivered']
def state
STATES[[collected?, ironed?, delivered?].take_while(&:itself).size]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.