This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'state_machine' | |
# Without state machine | |
regular_class = Class.new | |
regular_class_id = regular_class.object_id | |
regular_class = nil | |
# With state machine | |
machine_class = Class.new | |
machine_class.state_machine(:initial => :parked) do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HM < Module ; end | |
class Machine | |
def initialize(owner_class) | |
@helpers = helpers = { | |
:instance => HM.new, | |
:class => HM.new | |
} | |
owner_class.class_eval do |
OlderNewer