Skip to content

Instantly share code, notes, and snippets.

@fearoffish
Forked from jteneycke/step problem.rb
Created October 9, 2013 16:41
Show Gist options
  • Save fearoffish/6904272 to your computer and use it in GitHub Desktop.
Save fearoffish/6904272 to your computer and use it in GitHub Desktop.
def step?(step)
@current_step.nil? || current_step + 1 == step
end
» @object.current_step
=> 0
» @object.step?(0)
=> true
» @object.step?(1)
=> true
» @object.step?(2)
=> true
» @object.step?(3)
=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment