Sha256: e43f819838e13da3c73bfd244a5488c40a623d8682953b1c5db5114e7696fb75
Contents?: true
Size: 863 Bytes
Versions: 32
Compression:
Stored size: 863 Bytes
Contents
module Callbacks class PrivateMethodMultiple include AASM def initialize(options={}) @fail_event_guard = options[:fail_event_guard] @fail_transition_guard = options[:fail_transition_guard] @log = options[:log] reset_data end def reset_data @data = [] end def data @data.join(' ') end aasm(:left) do state :open, :initial => true state :closed event :close, :after => :after_event do transitions :to => :closed, :from => [:open] end event :open, :after => :after_event do transitions :to => :open, :from => :closed end end def log(text) @data << text puts text if @log end def aasm_write_state(*args); log('aasm_write_state'); true; end private def after_event; log('after_event'); end end end
Version data entries
32 entries across 32 versions & 1 rubygems