Skip to content

Instantly share code, notes, and snippets.

@Hates
Created September 14, 2009 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Hates/186893 to your computer and use it in GitHub Desktop.
Save Hates/186893 to your computer and use it in GitHub Desktop.
module States
CANCELLED = "cancelled"
DECLINED = "declined"
PASSIVE = "passive"
ACTIVE = "active"
APPROVED = "approved"
PENDING = "pending"
FLAGGED = "flagged"
COMPLETE = "complete"
def cancelled?
self.state == CANCELLED
end
def declined?
self.state == DECLINED
end
def passive?
self.state == PASSIVE
end
def active?
self.state == ACTIVE
end
def approved?
self.state == APPROVED
end
def pending?
self.state == PENDING
end
def flagged?
self.state == FLAGGED
end
def complete?
self.state == COMPLETE
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment