Inheritance

54 views
Skip to first unread message

Aard-Jan Kesteren, van

unread,
Jun 19, 2012, 5:24:35 AM6/19/12
to pluginaw...@googlegroups.com
Hi,

I absolutely love this gem, but have one question. In the summary of the gem I read that it supports inheritance, but I cannot find any documentation on this. 

Lets say I have a process called HireEmployee with some transitions and events. Now I want to implement a new process called HireReallyTalentedEmployee. This process is almost the same as HireEmployee, but just a little bit different. Wat I would like do to is to extend the HireEmployee class and add and remove some transitions.

Would something like this be possible? Love to see an example.  

Cheers, 
AJ

Matthew Wean

unread,
Jun 25, 2012, 11:42:35 PM6/25/12
to pluginaw...@googlegroups.com
I'm also interested in this. I'd like to have a default set of events but be able to override them in a subclass. I've seen a few places where this method was used, but I couldn't get it to work:

state_machines.clear
      
state_machines[:state] = StateMachine::Machine.new(SomeClass) do ...
Reply all
Reply to author
Forward
0 new messages