Skip to content

Instantly share code, notes, and snippets.

@toretore
Forked from VelizarHristov/before.rb
Last active Jan 9, 2016
Embed
What would you like to do?
PIPELINE = %w[booked collected ironed delivered]
def state
PIPELINE[@pipeline_position]
end
def advance
@pipeline_position += 1
end
PIPELINE.each_with_index do |name, position|
define_method "#{name}?" do
@pipeline_position >= position
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment