Module: ConcernedStates::Stateable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/concerned_states/stateable.rb
Constant Summary collapse
- PASSIVE =
"passive"- PENDING =
"pending"- DECLINED =
"declined"- APPROVED =
"approved"- INACTIVE =
"inactive"- ACTIVE =
"active"- FLAGGED =
"flagged"- SUSPENDED =
"suspended"- ARCHIVED =
"archived"- DELETED =
"deleted"- STARTED =
"started"- PAUSED =
"paused"- CANCELLED =
"cancelled"- COMPLETED =
"completed"- ERRORED =
"errored"
Instance Method Summary collapse
- #activate ⇒ Object
- #activate! ⇒ Object
- #active? ⇒ Boolean
- #approve ⇒ Object
- #approve! ⇒ Object
- #approved? ⇒ Boolean
- #archive ⇒ Object
- #archive! ⇒ Object
- #archived? ⇒ Boolean
- #cancel ⇒ Object
- #cancel! ⇒ Object
- #canceled? ⇒ Boolean
- #cancelled? ⇒ Boolean
- #complete ⇒ Object
- #complete! ⇒ Object
- #completed? ⇒ Boolean
- #decline ⇒ Object
- #decline! ⇒ Object
- #declined? ⇒ Boolean
- #delete ⇒ Object
- #delete! ⇒ Object
- #deleted? ⇒ Boolean
- #error ⇒ Object
- #error! ⇒ Object
- #errored? ⇒ Boolean
- #flag ⇒ Object
- #flag! ⇒ Object
- #flagged? ⇒ Boolean
- #inactivate ⇒ Object
- #inactivate! ⇒ Object
- #inactive? ⇒ Boolean
- #passivate ⇒ Object
- #passivate! ⇒ Object
- #passive? ⇒ Boolean
- #pause ⇒ Object
- #pause! ⇒ Object
- #paused? ⇒ Boolean
- #pendinate ⇒ Object
- #pendinate! ⇒ Object
- #pending? ⇒ Boolean
- #start ⇒ Object
- #start! ⇒ Object
- #started? ⇒ Boolean
- #suspend ⇒ Object
- #suspend! ⇒ Object
- #suspended? ⇒ Boolean
Instance Method Details
#activate ⇒ Object
88 |
# File 'lib/concerned_states/stateable.rb', line 88 def activate; self.state = ACTIVE; end |
#activate! ⇒ Object
89 |
# File 'lib/concerned_states/stateable.rb', line 89 def activate!; update_attribute(:state, ACTIVE); end |
#active? ⇒ Boolean
90 |
# File 'lib/concerned_states/stateable.rb', line 90 def active?; self.state == ACTIVE; end |
#approve ⇒ Object
80 |
# File 'lib/concerned_states/stateable.rb', line 80 def approve; self.state = APPROVED; end |
#approve! ⇒ Object
81 |
# File 'lib/concerned_states/stateable.rb', line 81 def approve!; update_attribute(:state, APPROVE); end |
#approved? ⇒ Boolean
82 |
# File 'lib/concerned_states/stateable.rb', line 82 def approved?; self.state == APPROVED; end |
#archive ⇒ Object
100 |
# File 'lib/concerned_states/stateable.rb', line 100 def archive; self.state = ARCHIVED; end |
#archive! ⇒ Object
101 |
# File 'lib/concerned_states/stateable.rb', line 101 def archive!; update_attribute(:state, ARCHIVED); end |
#archived? ⇒ Boolean
102 |
# File 'lib/concerned_states/stateable.rb', line 102 def archived?; self.state == ARCHIVED; end |
#cancel ⇒ Object
108 |
# File 'lib/concerned_states/stateable.rb', line 108 def cancel; self.state = CANCELLED; end |
#cancel! ⇒ Object
109 |
# File 'lib/concerned_states/stateable.rb', line 109 def cancel!; update_attribute(:state, CANCELLED); end |
#canceled? ⇒ Boolean
122 |
# File 'lib/concerned_states/stateable.rb', line 122 def canceled?; self.state == CANCELLED; end |
#cancelled? ⇒ Boolean
110 |
# File 'lib/concerned_states/stateable.rb', line 110 def cancelled?; self.state == CANCELLED; end |
#complete ⇒ Object
124 |
# File 'lib/concerned_states/stateable.rb', line 124 def complete; self.state = COMPLETED; end |
#complete! ⇒ Object
125 |
# File 'lib/concerned_states/stateable.rb', line 125 def complete!; update_attribute(:state, COMPLETED); end |
#completed? ⇒ Boolean
126 |
# File 'lib/concerned_states/stateable.rb', line 126 def completed?; self.state == COMPLETED; end |
#decline ⇒ Object
76 |
# File 'lib/concerned_states/stateable.rb', line 76 def decline; self.state = DECLINED; end |
#decline! ⇒ Object
77 |
# File 'lib/concerned_states/stateable.rb', line 77 def decline!; update_attribute(:state, DECLINED); end |
#declined? ⇒ Boolean
78 |
# File 'lib/concerned_states/stateable.rb', line 78 def declined?; self.state == DECLINED; end |
#delete ⇒ Object
104 |
# File 'lib/concerned_states/stateable.rb', line 104 def delete; self.state = DELETED; end |
#delete! ⇒ Object
105 |
# File 'lib/concerned_states/stateable.rb', line 105 def delete!; update_attribute(:state, DELETED); end |
#deleted? ⇒ Boolean
106 |
# File 'lib/concerned_states/stateable.rb', line 106 def deleted?; self.state == DELETED; end |
#error ⇒ Object
128 |
# File 'lib/concerned_states/stateable.rb', line 128 def error; self.state = ERRORED; end |
#error! ⇒ Object
129 |
# File 'lib/concerned_states/stateable.rb', line 129 def error!; update_attribute(:state, ERRORED); end |
#errored? ⇒ Boolean
130 |
# File 'lib/concerned_states/stateable.rb', line 130 def errored?; self.state == ERRORED; end |
#flag ⇒ Object
92 |
# File 'lib/concerned_states/stateable.rb', line 92 def flag; self.state = FLAGGED; end |
#flag! ⇒ Object
93 |
# File 'lib/concerned_states/stateable.rb', line 93 def flag!; update_attribute(:state, FLAGGED); end |
#flagged? ⇒ Boolean
94 |
# File 'lib/concerned_states/stateable.rb', line 94 def flagged?; self.state == FLAGGED; end |
#inactivate ⇒ Object
84 |
# File 'lib/concerned_states/stateable.rb', line 84 def inactivate; self.state = INACTIVE; end |
#inactivate! ⇒ Object
85 |
# File 'lib/concerned_states/stateable.rb', line 85 def inactivate!; update_attribute(:state, INACTIVE); end |
#inactive? ⇒ Boolean
86 |
# File 'lib/concerned_states/stateable.rb', line 86 def inactive?; self.state == INACTIVE; end |
#passivate ⇒ Object
68 |
# File 'lib/concerned_states/stateable.rb', line 68 def passivate; self.state = PASSIVE; end |
#passivate! ⇒ Object
69 |
# File 'lib/concerned_states/stateable.rb', line 69 def passivate!; update_attribute(:state, PASSIVE); end |
#passive? ⇒ Boolean
70 |
# File 'lib/concerned_states/stateable.rb', line 70 def passive?; self.state == PASSIVE; end |
#pause ⇒ Object
116 |
# File 'lib/concerned_states/stateable.rb', line 116 def pause; self.state = PAUSED; end |
#pause! ⇒ Object
117 |
# File 'lib/concerned_states/stateable.rb', line 117 def pause!; update_attribute(:state, PAUSE); end |
#paused? ⇒ Boolean
118 |
# File 'lib/concerned_states/stateable.rb', line 118 def paused?; self.state == PAUSED; end |
#pendinate ⇒ Object
72 |
# File 'lib/concerned_states/stateable.rb', line 72 def pendinate; self.state = PENDING; end |
#pendinate! ⇒ Object
73 |
# File 'lib/concerned_states/stateable.rb', line 73 def pendinate!; update_attribute(:state, PENDING); end |
#pending? ⇒ Boolean
74 |
# File 'lib/concerned_states/stateable.rb', line 74 def pending?; self.state == PENDING; end |
#start ⇒ Object
112 |
# File 'lib/concerned_states/stateable.rb', line 112 def start; self.state = STARTED; end |
#start! ⇒ Object
113 |
# File 'lib/concerned_states/stateable.rb', line 113 def start!; update_attribute(:state, STARTED); end |
#started? ⇒ Boolean
114 |
# File 'lib/concerned_states/stateable.rb', line 114 def started?; self.state == STARTED; end |
#suspend ⇒ Object
96 |
# File 'lib/concerned_states/stateable.rb', line 96 def suspend; self.state = SUSPENDED; end |
#suspend! ⇒ Object
97 |
# File 'lib/concerned_states/stateable.rb', line 97 def suspend!; update_attribute(:state, SUSPENDED); end |
#suspended? ⇒ Boolean
98 |
# File 'lib/concerned_states/stateable.rb', line 98 def suspended?; self.state == SUSPENDED; end |