Skip to content

Commit

Permalink
Tweak README docs
Browse files Browse the repository at this point in the history
  • Loading branch information
obrie committed Apr 5, 2009
1 parent b4b65d3 commit 2623e4d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ Class definition:
end
end

*Note* the comment made on the +initialize+ method in the class. In order for
state machine attributes to be properly initialized, <tt>super()</tt> must be called.
See StateMachine::MacroMethods for more information about this.

Using the above class as an example, you can interact with the state machine
like so:

Expand Down Expand Up @@ -217,10 +221,6 @@ like so:

vehicle.fire_events!(:ignite, :enable_alarm) # => StateMachine::InvalidTransition: Cannot run events in parallel: ignite, enable_alarm

*Note* the comment made on the +initialize+ method in the class. In order for
state machine attributes to be properly initialized, <tt>super()</tt> must be called.
See StateMachine::MacroMethods for more information about this.

== Integrations

In addition to being able to define state machines on all Ruby classes, a set of
Expand Down Expand Up @@ -267,7 +267,7 @@ saving the record, named scopes, validation errors, and observers. For example,
# log message
end

# Generic transition callback *before* the transition is performed
# Generic transition callback *after* the transition is performed
def after_transition(vehicle, transition)
Audit.log(vehicle, transition)
end
Expand Down Expand Up @@ -318,7 +318,7 @@ callbacks, validation errors, and observers. For example,
# log message (self is the record)
end

# Generic transition callback *before* the transition is performed
# Generic transition callback *after* the transition is performed
after_transition do |transition|
Audit.log(self, transition) # self is the record
end
Expand Down

0 comments on commit 2623e4d

Please sign in to comment.