Skip to content

Instantly share code, notes, and snippets.

@toretore
Forked from VelizarHristov/before.rb
Last active January 9, 2016 17:00
Show Gist options
  • Save toretore/3f1da0f2059a4d667831 to your computer and use it in GitHub Desktop.
Save toretore/3f1da0f2059a4d667831 to your computer and use it in GitHub Desktop.
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