### Home Classes Methods

### In Files

- lib/state_machine/core_ext/class/state_machine.rb
- lib/state_machine/yard/templates/default/class/html/setup.rb
- lib/state_machine/integrations/data_mapper/observer.rb
- lib/state_machine/integrations/active_model/observer.rb

### Parent

BasicObject

### Methods

- #init
- #state_machine_details
- #state_machine_image_path
- #state_machines

### Included Modules

- StateMachine::MacroMethods
- StateMachine::Integrations::DataMapper::Observer
- StateMachine::Integrations::ActiveModel::Observer

### Files

- LICENSE

### Class/Module Index

Quicksearch

- StateMachine
- StateMachine::AllMatcher
- StateMachine::Assertions
- StateMachine::AttributeTransitionCollection
- StateMachine::BlacklistMatcher
- StateMachine::Branch
- StateMachine::Callback
- StateMachine::ClassMethods
- StateMachine::Error
- StateMachine::EvalHelpers
- StateMachine::Event
- StateMachine::EventCollection
- StateMachine::Graph
- StateMachine::InstanceMethods
- StateMachine::IntegrationNotFound
- StateMachine::Integrations
- StateMachine::Integrations::ActiveModel
- StateMachine::Integrations::ActiveModel::Observer
- StateMachine::Integrations::ActiveModel::ObserverUpdate
- StateMachine::Integrations::ActiveRecord
- StateMachine::Integrations::Base
- StateMachine::Integrations::Base::ClassMethods
- StateMachine::Integrations::DataMapper
- StateMachine::Integrations::DataMapper::Observer
- StateMachine::Integrations::MongoMapper
- StateMachine::Integrations::Mongoid
- StateMachine::Integrations::Sequel
- StateMachine::InvalidEvent
- StateMachine::InvalidParallelTransition
- StateMachine::InvalidTransition
- StateMachine::LoopbackMatcher
- StateMachine::Machine
- StateMachine::MachineCollection
- StateMachine::MacroMethods
- StateMachine::Matcher
- StateMachine::MatcherHelpers
- StateMachine::NodeCollection
- StateMachine::Path
- StateMachine::PathCollection
- StateMachine::RailsEngine
- StateMachine::State
- StateMachine::StateCollection
- StateMachine::StateContext
- StateMachine::Transition
- StateMachine::TransitionCollection
- StateMachine::WhitelistMatcher
- StateMachine::YARD
- StateMachine::YARD::Handlers
- StateMachine::YARD::Handlers::Base
- StateMachine::YARD::Handlers::Event
- StateMachine::YARD::Handlers::Machine
- StateMachine::YARD::Handlers::State
- StateMachine::YARD::Handlers::Transition
- Object

No matching classes.

# Object

### Public Instance Methods

init() click to toggle source

Define where state machine descriptions will be rendered

    # File lib/state_machine/yard/templates/default/class/html/setup.rb, line 4
    def init
      super
      sections.place(:state_machine_details).before(:children)
    end

state_machine_details() click to toggle source

Renders state machine details in the main content of the class's documentation

    # File lib/state_machine/yard/templates/default/class/html/setup.rb, line 10
    def state_machine_details
      erb(:state_machines) if state_machines
    end

state_machine_image_path(machine) click to toggle source

Generates the image path for the given machine's visualization

    # File lib/state_machine/yard/templates/default/class/html/setup.rb, line 26
    def state_machine_image_path(machine)
      base_path = File.dirname(serializer.serialized_path(object))
      image_name = "#{object.name}_#{machine[:name]}"
      "#{File.join(base_path, image_name)}.png"
    end

state_machines() click to toggle source

Gets a list of state machines prased for this class

    # File lib/state_machine/yard/templates/default/class/html/setup.rb, line 15
    def state_machines
      @state_machines ||= begin
        if state_machines = object['state_machines']
          state_machines.each do |name, machine|
            serializer.serialize(state_machine_image_path(machine), machine[:image]) if machine[:image]
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.