aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib/active_model/state_machine/machine.rb
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2009-08-05 14:52:07 -0300
committerEmilio Tagua <miloops@gmail.com>2009-08-05 14:52:07 -0300
commitae175a5354321fd64393b9e1f4080437ee3cdf74 (patch)
tree43a858b6f5c88ff418c97274f34abe833ff490ce /activemodel/lib/active_model/state_machine/machine.rb
parentf8eb4434d61fc1585c9b88dbb2d9159ea1f5b2fa (diff)
parentcfd421daa2b04216e27d666361eb4053020e027d (diff)
downloadrails-ae175a5354321fd64393b9e1f4080437ee3cdf74.tar.gz
rails-ae175a5354321fd64393b9e1f4080437ee3cdf74.tar.bz2
rails-ae175a5354321fd64393b9e1f4080437ee3cdf74.zip
Merge commit 'rails/master'
Diffstat (limited to 'activemodel/lib/active_model/state_machine/machine.rb')
-rw-r--r--activemodel/lib/active_model/state_machine/machine.rb29
1 files changed, 13 insertions, 16 deletions
diff --git a/activemodel/lib/active_model/state_machine/machine.rb b/activemodel/lib/active_model/state_machine/machine.rb
index a5ede021b1..777531213e 100644
--- a/activemodel/lib/active_model/state_machine/machine.rb
+++ b/activemodel/lib/active_model/state_machine/machine.rb
@@ -1,6 +1,3 @@
-require 'active_model/state_machine/state'
-require 'active_model/state_machine/event'
-
module ActiveModel
module StateMachine
class Machine
@@ -57,22 +54,22 @@ module ActiveModel
"@#{@name}_current_state"
end
- private
- def state(name, options = {})
- @states << (state_index[name] ||= State.new(name, :machine => self)).update(options)
- end
+ private
+ def state(name, options = {})
+ @states << (state_index[name] ||= State.new(name, :machine => self)).update(options)
+ end
- def event(name, options = {}, &block)
- (@events[name] ||= Event.new(self, name)).update(options, &block)
- end
+ def event(name, options = {}, &block)
+ (@events[name] ||= Event.new(self, name)).update(options, &block)
+ end
- def event_fired_callback
- @event_fired_callback ||= (@name == :default ? '' : "#{@name}_") + 'event_fired'
- end
+ def event_fired_callback
+ @event_fired_callback ||= (@name == :default ? '' : "#{@name}_") + 'event_fired'
+ end
- def event_failed_callback
- @event_failed_callback ||= (@name == :default ? '' : "#{@name}_") + 'event_failed'
- end
+ def event_failed_callback
+ @event_failed_callback ||= (@name == :default ? '' : "#{@name}_") + 'event_failed'
+ end
end
end
end