Methods
Public Instance methods
aasm_event(name, &block)
    # File lib/aasm.rb, line 36
36:     def aasm_event(name, &block)
37:       unless aasm_events.has_key?(name)
38:         aasm_events[name] = AASM::SupportingClasses::Event.new(name, &block)
39:       end
40: 
41:       define_method("#{name.to_s}!") do
42:         new_state = self.class.aasm_events[name].fire(self)
43:         unless new_state.nil?
44:           if self.respond_to?(:aasm_event_fired)
45:             self.aasm_event_fired(self.aasm_current_state, new_state)
46:           end
47:           
48:           self.aasm_current_state_with_persistence = new_state
49:           true
50:         else
51:           if self.respond_to?(:aasm_event_failed)
52:             self.aasm_event_failed(name)
53:           end
54:           
55:           false
56:         end
57:       end
58: 
59:       define_method("#{name.to_s}") do
60:         new_state = self.class.aasm_events[name].fire(self)
61:         unless new_state.nil?
62:           if self.respond_to?(:aasm_event_fired)
63:             self.aasm_event_fired(self.aasm_current_state, new_state)
64:           end
65:           
66:           self.aasm_current_state = new_state
67:           true
68:         else
69:           if self.respond_to?(:aasm_event_failed)
70:             self.aasm_event_failed(name)
71:           end
72:           
73:           false
74:         end
75:       end
76: 
77:     end
aasm_events()
    # File lib/aasm.rb, line 83
83:     def aasm_events
84:       @aasm_events ||= {}
85:     end
aasm_initial_state(set_state=nil)
    # File lib/aasm.rb, line 15
15:     def aasm_initial_state(set_state=nil)
16:       if set_state
17:         aasm_initial_state = set_state
18:       else
19:         @aasm_initial_state
20:       end
21:     end
aasm_initial_state=(state)
    # File lib/aasm.rb, line 23
23:     def aasm_initial_state=(state)
24:       @aasm_initial_state = state
25:     end
aasm_state(name, options={})
    # File lib/aasm.rb, line 27
27:     def aasm_state(name, options={})
28:       aasm_states << name unless aasm_states.include?(name)
29:       self.aasm_initial_state = name unless self.aasm_initial_state
30: 
31:       define_method("#{name.to_s}?") do
32:         aasm_current_state == name
33:       end
34:     end
aasm_states()
    # File lib/aasm.rb, line 79
79:     def aasm_states
80:       @aasm_states ||= []
81:     end
aasm_states_for_select()
    # File lib/aasm.rb, line 87
87:     def aasm_states_for_select
88:       aasm_states.collect { |state| [state.to_s.gsub(/_/, ' ').capitalize, state] }
89:     end