Method: StateFu::Machine#helper
- Defined in:
- lib/machine.rb
#helper(*modules_to_add) ⇒ Object
the modules listed here will be mixed into Binding and Transition objects for this machine. use this to define methods, references or data useful to you during transitions, event hooks, or in general use of StateFu.
They can be supplied as a string/symbol (as per rails controller helpers), or a Module.
To do this globally, just duck-punch StateFu::Machine / StateFu::Binding.
107 108 109 |
# File 'lib/machine.rb', line 107 def helper *modules_to_add modules_to_add.each { |mod| helpers << mod } end |