Module: BigMachine::ClassMethods
- Defined in:
- lib/big_machine.rb
Instance Method Summary collapse
- #active_record_model? ⇒ Boolean
- #big_machine(options) ⇒ Object
- #initial_state_class ⇒ Object
- #set_initial_state_class ⇒ Object
Instance Method Details
#active_record_model? ⇒ Boolean
21 22 23 |
# File 'lib/big_machine.rb', line 21 def active_record_model? defined?(::ActiveRecord::Base) && self.ancestors.include?(::ActiveRecord::Base) end |
#big_machine(options) ⇒ Object
25 26 27 28 29 |
# File 'lib/big_machine.rb', line 25 def big_machine() self.initial_state = [:initial_state] self.workflow = [:workflow] set_initial_state_class end |
#initial_state_class ⇒ Object
31 32 33 |
# File 'lib/big_machine.rb', line 31 def initial_state_class @initial_state_class end |
#set_initial_state_class ⇒ Object
35 36 37 38 |
# File 'lib/big_machine.rb', line 35 def set_initial_state_class @initial_state_class = self.initial_state.to_s.camelize.constantize include ::BigMachine::AvailableMethods end |