Skip to content

Instantly share code, notes, and snippets.

@dpickett
Created March 11, 2009 19:59
Show Gist options
  • Save dpickett/77683 to your computer and use it in GitHub Desktop.
Save dpickett/77683 to your computer and use it in GitHub Desktop.
def method_missing(name, *args)
if current_state.events(name)
process_event!(name, *args)
elsif name.to_s[-1].chr == '?' and states(name.to_s[0..-2].to_sym)
current_state == states(name.to_s[0..-2].to_sym)
else
super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment