From e7c1ec684254f0a99557e469fc9a5d67692f4827 Mon Sep 17 00:00:00 2001 From: Travis Tilley Date: Sun, 17 Jan 2010 01:34:58 -0500 Subject: [PATCH] rebuild docs --- .gitignore | 2 + classes/AASM.html | 66 +-- classes/AASM/ClassMethods.html | 32 +- classes/AASM/Persistence.html | 24 +- .../Persistence/ActiveRecordPersistence.html | 10 +- .../ActiveRecordPersistence/ClassMethods.html | 52 +- .../NamedScopeMethods.html | 10 +- .../ActiveRecordPersistence/ReadState.html | 10 +- .../ActiveRecordPersistence/WriteState.html | 10 +- .../WriteStateWithoutPersistence.html | 10 +- classes/AASM/StateMachine.html | 132 ++--- classes/AASM/SupportingClasses.html | 6 +- classes/AASM/SupportingClasses/Event.html | 502 ++++++++++-------- classes/AASM/SupportingClasses/State.html | 238 +++++---- .../SupportingClasses/StateTransition.html | 90 ++-- created.rid | 2 +- css/main.css | 15 + files/README_rdoc.html | 9 +- files/lib/aasm/aasm_rb.html | 2 +- files/lib/aasm/event_rb.html | 9 +- .../active_record_persistence_rb.html | 2 +- files/lib/aasm/persistence_rb.html | 9 +- files/lib/aasm/state_machine_rb.html | 16 +- files/lib/aasm/state_rb.html | 9 +- files/lib/aasm/state_transition_rb.html | 9 +- files/lib/aasm/supporting_classes_rb.html | 52 ++ files/lib/aasm_rb.html | 16 +- index.html | 2 +- panel/search_index.js | 2 +- panel/tree.js | 2 +- 30 files changed, 714 insertions(+), 636 deletions(-) create mode 100644 .gitignore create mode 100644 files/lib/aasm/supporting_classes_rb.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6ef218 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea + diff --git a/classes/AASM.html b/classes/AASM.html index a8478df..87a956b 100644 --- a/classes/AASM.html +++ b/classes/AASM.html @@ -23,17 +23,9 @@
  • lib/aasm/aasm.rb
  • -
  • lib/aasm/event.rb
  • -
  • lib/aasm/persistence/active_record_persistence.rb
  • -
  • lib/aasm/persistence.rb
  • - -
  • lib/aasm/state.rb
  • - -
  • lib/aasm/state_machine.rb
  • - -
  • lib/aasm/state_transition.rb
  • +
  • lib/aasm.rb
  • @@ -55,13 +47,13 @@
    @@ -100,9 +92,9 @@
    Instance Public methods
    -
    +
    - aasm_current_state() + aasm_current_state()
    @@ -118,13 +110,13 @@ Instance methods
    -
    -
    # File lib/aasm/aasm.rb, line 80
    +                    
    +
    # File lib/aasm/aasm.rb, line 75
       def aasm_current_state
         return @aasm_current_state if @aasm_current_state
     
    @@ -141,9 +133,9 @@ Instance methods
                 
    -
    +
    - aasm_enter_initial_state() + aasm_enter_initial_state()
    @@ -152,13 +144,13 @@ Instance methods
    -
    -
    # File lib/aasm/aasm.rb, line 91
    +                    
    +
    # File lib/aasm/aasm.rb, line 86
       def aasm_enter_initial_state
         state_name = aasm_determine_state_name(self.class.aasm_initial_state)
         state = aasm_state_object_for_state(state_name)
    @@ -176,9 +168,9 @@ Instance methods
                 
    -
    +
    - aasm_events_for_current_state() + aasm_events_for_current_state()
    @@ -187,13 +179,13 @@ Instance methods
    -
    -
    # File lib/aasm/aasm.rb, line 103
    +                    
    +
    # File lib/aasm/aasm.rb, line 98
       def aasm_events_for_current_state
         aasm_events_for_state(aasm_current_state)
       end
    @@ -203,9 +195,9 @@ Instance methods
    -
    +
    - aasm_events_for_state(state) + aasm_events_for_state(state)
    @@ -214,13 +206,13 @@ Instance methods
    -
    -
    # File lib/aasm/aasm.rb, line 107
    +                    
    +
    # File lib/aasm/aasm.rb, line 102
       def aasm_events_for_state(state)
         events = self.class.aasm_events.values.select {|event| event.transitions_from_state?(state) }
         events.map {|event| event.name}
    diff --git a/classes/AASM/ClassMethods.html b/classes/AASM/ClassMethods.html
    index 6c3c662..93e5212 100644
    --- a/classes/AASM/ClassMethods.html
    +++ b/classes/AASM/ClassMethods.html
    @@ -99,11 +99,11 @@
                         
                         
    -
    # File lib/aasm/aasm.rb, line 49
    +                        
    # File lib/aasm/aasm.rb, line 44
         def aasm_event(name, options = {}, &block)
           sm = AASM::StateMachine[self]
     
    @@ -138,11 +138,11 @@
                         
                         
    -
    # File lib/aasm/aasm.rb, line 69
    +                        
    # File lib/aasm/aasm.rb, line 64
         def aasm_events
           AASM::StateMachine[self].events
         end
    @@ -165,11 +165,11 @@
    -
    # File lib/aasm/aasm.rb, line 27
    +                        
    # File lib/aasm/aasm.rb, line 22
         def aasm_initial_state(set_state=nil)
           if set_state
             AASM::StateMachine[self].initial_state = set_state
    @@ -196,11 +196,11 @@
                         
                         
    -
    # File lib/aasm/aasm.rb, line 35
    +                        
    # File lib/aasm/aasm.rb, line 30
         def aasm_initial_state=(state)
           AASM::StateMachine[self].initial_state = state
         end
    @@ -223,11 +223,11 @@
    -
    # File lib/aasm/aasm.rb, line 39
    +                        
    # File lib/aasm/aasm.rb, line 34
         def aasm_state(name, options={})
           sm = AASM::StateMachine[self]
           sm.create_state(name, options)
    @@ -256,11 +256,11 @@
                         
                         
    -
    # File lib/aasm/aasm.rb, line 65
    +                        
    # File lib/aasm/aasm.rb, line 60
         def aasm_states
           AASM::StateMachine[self].states
         end
    @@ -283,11 +283,11 @@
    -
    # File lib/aasm/aasm.rb, line 73
    +                        
    # File lib/aasm/aasm.rb, line 68
         def aasm_states_for_select
           AASM::StateMachine[self].states.map { |state| state.for_select }
         end
    @@ -310,11 +310,11 @@
    -
    # File lib/aasm/aasm.rb, line 22
    +                        
    # File lib/aasm/aasm.rb, line 17
         def inherited(klass)
           AASM::StateMachine[klass] = AASM::StateMachine[self].clone
           super
    diff --git a/classes/AASM/Persistence.html b/classes/AASM/Persistence.html
    index 468469c..a737ff3 100644
    --- a/classes/AASM/Persistence.html
    +++ b/classes/AASM/Persistence.html
    @@ -21,10 +21,10 @@
             
             
         
    @@ -96,20 +96,20 @@ href="Persistence/ActiveRecordPersistence.html">ActiveRecordPersistence
    -
    # File lib/aasm/persistence.rb, line 6
    -    def self.set_persistence(base)
    -      # Use a fancier auto-loading thingy, perhaps.  When there are more persistence engines.
    -      hierarchy = base.ancestors.map {|klass| klass.to_s}
    +                        
    # File lib/aasm/persistence.rb, line 5
    +  def self.set_persistence(base)
    +    # Use a fancier auto-loading thingy, perhaps.  When there are more persistence engines.
    +    hierarchy = base.ancestors.map {|klass| klass.to_s}
     
    -      if hierarchy.include?("ActiveRecord::Base")
    -        require File.join(File.dirname(__FILE__), 'persistence', 'active_record_persistence')
    -        base.send(:include, AASM::Persistence::ActiveRecordPersistence)
    -      end
    -    end
    + if hierarchy.include?("ActiveRecord::Base") + require File.join(File.dirname(__FILE__), 'persistence', 'active_record_persistence') + base.send(:include, AASM::Persistence::ActiveRecordPersistence) + end + end
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence.html b/classes/AASM/Persistence/ActiveRecordPersistence.html index 9bd76af..d06309f 100644 --- a/classes/AASM/Persistence/ActiveRecordPersistence.html +++ b/classes/AASM/Persistence/ActiveRecordPersistence.html @@ -43,7 +43,7 @@
    @@ -82,9 +82,9 @@
    Class Public methods
    -
    +
    - included(base) + included(base)
    @@ -150,12 +150,12 @@ following 2 are equivalent
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 34
           def self.included(base)
             base.extend AASM::Persistence::ActiveRecordPersistence::ClassMethods
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html b/classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html
    index 2443a7e..6ea0dd0 100644
    --- a/classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html
    +++ b/classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html
    @@ -43,7 +43,7 @@
             
    @@ -52,9 +52,9 @@
    @@ -63,7 +63,7 @@
    @@ -72,7 +72,7 @@
    @@ -94,15 +94,15 @@
    Instance Public methods
    -
    +
    - aasm_column(column_name=nil) + aasm_column(column_name=nil)

    -Maps to the aasm_column in the +Maps to the aasm_column in the database. Deafults to “aasm_state“. You can write:

    @@ -140,12 +140,12 @@ This method is both a getter and a setter
                     
                     
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 82
             def aasm_column(column_name=nil)
               if column_name
    @@ -164,9 +164,9 @@ This method is both a getter and a setter
                 
    -
    +
    - calculate_in_state(state, *args) + calculate_in_state(state, *args)
    @@ -175,12 +175,12 @@ This method is both a getter and a setter
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 106
             def calculate_in_state(state, *args)
               with_state_scope state do
    @@ -193,9 +193,9 @@ This method is both a getter and a setter
                 
    -
    +
    - count_in_state(state, *args) + count_in_state(state, *args)
    @@ -204,12 +204,12 @@ This method is both a getter and a setter
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 100
             def count_in_state(state, *args)
               with_state_scope state do
    @@ -222,9 +222,9 @@ This method is both a getter and a setter
                 
    -
    +
    - find_in_state(number, state, *args) + find_in_state(number, state, *args)
    @@ -233,12 +233,12 @@ This method is both a getter and a setter
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 94
             def find_in_state(number, state, *args)
               with_state_scope state do
    @@ -253,9 +253,9 @@ This method is both a getter and a setter
                 
    Instance Protected methods
    -
    +
    - with_state_scope(state) + with_state_scope(state)
    @@ -264,12 +264,12 @@ This method is both a getter and a setter
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 113
             def with_state_scope(state)
               with_scope :find => {:conditions => ["#{table_name}.#{aasm_column} = ?", state.to_s]} do
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html b/classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html
    index 05e3fb8..1aea8a1 100644
    --- a/classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html
    +++ b/classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html
    @@ -43,7 +43,7 @@
             
    @@ -65,9 +65,9 @@
    Instance Public methods
    -
    +
    - aasm_state_with_named_scope(name, options = {}) + aasm_state_with_named_scope(name, options = {})
    @@ -76,12 +76,12 @@
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 241
             def aasm_state_with_named_scope name, options = {}
               aasm_state_without_named_scope name, options
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html b/classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html
    index 4502949..d5fd2b7 100644
    --- a/classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html
    +++ b/classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html
    @@ -43,7 +43,7 @@
             
    @@ -65,9 +65,9 @@
    Instance Public methods
    -
    +
    - aasm_read_state() + aasm_read_state()
    @@ -112,12 +112,12 @@ This allows for nil aasm states - be sure to add validation to your model
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 231
             def aasm_read_state
               if new_record?
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html b/classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html
    index 7d18004..817fe0e 100644
    --- a/classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html
    +++ b/classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html
    @@ -43,7 +43,7 @@
             
    @@ -65,9 +65,9 @@
    Instance Public methods
    -
    +
    - aasm_write_state(state) + aasm_write_state(state)
    @@ -94,12 +94,12 @@ NOTE: intended to be called from an event
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 192
             def aasm_write_state(state)
               old_value = read_attribute(self.class.aasm_column)
    diff --git a/classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html b/classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html
    index f006000..ac8155f 100644
    --- a/classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html
    +++ b/classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html
    @@ -43,7 +43,7 @@
             
    @@ -65,9 +65,9 @@
    Instance Public methods
    -
    +
    - aasm_write_state_without_persistence(state) + aasm_write_state_without_persistence(state)
    @@ -97,12 +97,12 @@ NOTE: intended to be called from an event
    -
    +
    # File lib/aasm/persistence/active_record_persistence.rb, line 176
             def aasm_write_state_without_persistence(state)
               write_attribute(self.class.aasm_column, state.to_s)
    diff --git a/classes/AASM/StateMachine.html b/classes/AASM/StateMachine.html
    index 464c00b..327ed9b 100644
    --- a/classes/AASM/StateMachine.html
    +++ b/classes/AASM/StateMachine.html
    @@ -49,9 +49,9 @@
             
    @@ -60,9 +60,9 @@
    @@ -71,7 +71,7 @@
    @@ -137,37 +137,10 @@
    Class Public methods
    -
    -
    - - [](*args) - -
    - - - - -
    - -
    -
    # File lib/aasm/state_machine.rb, line 5
    -    def self.[](*args)
    -      (@machines ||= {})[args]
    -    end
    -
    -
    - -
    -
    - []=(*args) + [](*args)
    @@ -178,15 +151,14 @@
    -
    # File lib/aasm/state_machine.rb, line 9
    -    def self.[]=(*args)
    -      val = args.pop
    -      (@machines ||= {})[args] = val
    -    end
    +
    # File lib/aasm/state_machine.rb, line 2
    +  def self.[](*args)
    +    (@machines ||= {})[args]
    +  end
    @@ -195,7 +167,7 @@
    - new(name) + []=(*args)
    @@ -206,29 +178,24 @@
    -
    # File lib/aasm/state_machine.rb, line 17
    -    def initialize(name)
    -      @name = name
    -      @initial_state = nil
    -      @states = []
    -      @events = {}
    -      @config = OpenStruct.new
    -    end
    +
    # File lib/aasm/state_machine.rb, line 6
    +  def self.[]=(*args)
    +    val = args.pop
    +    (@machines ||= {})[args] = val
    +  end
    -
    Instance Public methods
    -
    - clone() + new(name)
    @@ -239,26 +206,29 @@
    -
    # File lib/aasm/state_machine.rb, line 25
    -    def clone
    -      klone = super
    -      klone.states = states.clone
    -      klone.events = events.clone
    -      klone
    -    end
    +
    # File lib/aasm/state_machine.rb, line 14
    +  def initialize(name)
    +    @name = name
    +    @initial_state = nil
    +    @states = []
    +    @events = {}
    +    @config = OpenStruct.new
    +  end
    +
    Instance Public methods
    +
    - create_state(name, options) + clone()
    @@ -269,14 +239,44 @@
    -
    # File lib/aasm/state_machine.rb, line 32
    -    def create_state(name, options)
    -      @states << AASM::SupportingClasses::State.new(name, options) unless @states.include?(name)
    -    end
    +
    # File lib/aasm/state_machine.rb, line 22
    +  def clone
    +    klone = super
    +    klone.states = states.clone
    +    klone.events = events.clone
    +    klone
    +  end
    +
    +
    + +
    + +
    +
    + + create_state(name, options) + +
    + + + + +
    + +
    +
    # File lib/aasm/state_machine.rb, line 29
    +  def create_state(name, options)
    +    @states << AASM::SupportingClasses::State.new(name, options) unless @states.include?(name)
    +  end
    diff --git a/classes/AASM/SupportingClasses.html b/classes/AASM/SupportingClasses.html index f9b3573..7de97cb 100644 --- a/classes/AASM/SupportingClasses.html +++ b/classes/AASM/SupportingClasses.html @@ -21,11 +21,7 @@
    diff --git a/classes/AASM/SupportingClasses/Event.html b/classes/AASM/SupportingClasses/Event.html index dc74aa2..4af449f 100644 --- a/classes/AASM/SupportingClasses/Event.html +++ b/classes/AASM/SupportingClasses/Event.html @@ -49,7 +49,7 @@
    @@ -58,7 +58,7 @@
    @@ -67,7 +67,7 @@
    @@ -76,7 +76,9 @@
    @@ -85,7 +87,7 @@
    @@ -94,7 +96,7 @@
    @@ -103,9 +105,9 @@
    @@ -114,7 +116,7 @@
    @@ -164,203 +166,10 @@
    Class Public methods
    -
    -
    - - new(name, options = {}, &block) - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 8
    -      def initialize(name, options = {}, &block)
    -        @name = name
    -        @transitions = []
    -        update(options, &block)
    -      end
    -
    -
    - -
    - -
    Instance Public methods
    - -
    -
    - - ==(event) - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 49
    -      def ==(event)
    -        if event.is_a? Symbol
    -          name == event
    -        else
    -          name == event.name
    -        end
    -      end
    -
    -
    - -
    - -
    -
    - - all_transitions() - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 38
    -      def all_transitions
    -        @transitions
    -      end
    -
    -
    - -
    - -
    -
    - - call_action(action, record) - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 42
    -      def call_action(action, record)
    -        action = @options[action]
    -        action.is_a?(Array) ?
    -                action.each {|a| _call_action(a, record)} :
    -                _call_action(action, record)
    -      end
    -
    -
    - -
    - -
    -
    - - execute_success_callback(obj, success = nil) - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 68
    -      def execute_success_callback(obj, success = nil)
    -        callback = success || @success
    -        case(callback)
    -          when String, Symbol
    -            obj.send(callback)
    -          when Proc
    -            callback.call(obj)
    -          when Array
    -            callback.each{|meth|self.execute_success_callback(obj, meth)}
    -        end
    -      end
    -
    -
    - -
    - -
    -
    - - fire(obj, to_state=nil, *args) - -
    - - - - -
    - -
    -
    # File lib/aasm/event.rb, line 14
    -      def fire(obj, to_state=nil, *args)
    -        transitions = @transitions.select { |t| t.from == obj.aasm_current_state }
    -        raise AASM::InvalidTransition, "Event '#{name}' cannot transition from '#{obj.aasm_current_state}'" if transitions.size == 0
    -
    -        next_state = nil
    -        transitions.each do |transition|
    -          next if to_state and !Array(transition.to).include?(to_state)
    -          if transition.perform(obj)
    -            next_state = to_state || Array(transition.to).first
    -            transition.execute(obj, *args)
    -            break
    -          end
    -        end
    -        next_state
    -      end
    -
    -
    - -
    -
    - transitions_from_state(state) + new(name, options = {}, &block)
    @@ -371,23 +180,27 @@
    -
    # File lib/aasm/event.rb, line 34
    -      def transitions_from_state(state)
    -        @transitions.select { |t| t.from == state }
    -      end
    +
    # File lib/aasm/event.rb, line 4
    +  def initialize(name, options = {}, &block)
    +    @name = name
    +    @transitions = []
    +    update(options, &block)
    +  end
    +
    Instance Public methods
    +
    -
    +
    - transitions_from_state?(state) + ==(event)
    @@ -396,16 +209,47 @@
    -
    -
    # File lib/aasm/event.rb, line 30
    -      def transitions_from_state?(state)
    -        @transitions.any? { |t| t.from == state }
    -      end
    +
    +
    # File lib/aasm/event.rb, line 45
    +  def ==(event)
    +    if event.is_a? Symbol
    +      name == event
    +    else
    +      name == event.name
    +    end
    +  end
    +
    +
    + +
    + +
    +
    + + all_transitions() + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 34
    +  def all_transitions
    +    @transitions
    +  end
    @@ -414,7 +258,7 @@
    - update(options = {}, &block) + call_action(action, record)
    @@ -425,21 +269,219 @@
    -
    # File lib/aasm/event.rb, line 57
    -      def update(options = {}, &block)
    -        if options.key?(:success) then
    -          @success = options[:success]
    -        end
    -        if block then
    -          instance_eval(&block)
    -        end
    -        @options = options
    -        self
    -      end
    +
    # File lib/aasm/event.rb, line 38
    +  def call_action(action, record)
    +    action = @options[action]
    +    action.is_a?(Array) ?
    +            action.each {|a| _call_action(a, record)} :
    +            _call_action(action, record)
    +  end
    +
    +
    + +
    + +
    +
    + + execute_error_callback(obj, error, error_callback=nil) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 79
    +  def execute_error_callback(obj, error, error_callback=nil)
    +    callback = error_callback || @error
    +    raise error unless callback
    +    case(callback)
    +      when String, Symbol
    +        raise NoMethodError unless obj.respond_to?(callback.to_sym)
    +        obj.send(callback, error)
    +      when Proc
    +        callback.call(obj, error)
    +      when Array
    +        callback.each{|meth|self.execute_error_callback(obj, error, meth)}
    +    end
    +  end
    +
    +
    + +
    + +
    +
    + + execute_success_callback(obj, success = nil) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 67
    +  def execute_success_callback(obj, success = nil)
    +    callback = success || @success
    +    case(callback)
    +      when String, Symbol
    +        obj.send(callback)
    +      when Proc
    +        callback.call(obj)
    +      when Array
    +        callback.each{|meth|self.execute_success_callback(obj, meth)}
    +    end
    +  end
    +
    +
    + +
    + +
    +
    + + fire(obj, to_state=nil, *args) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 10
    +  def fire(obj, to_state=nil, *args)
    +    transitions = @transitions.select { |t| t.from == obj.aasm_current_state }
    +    raise AASM::InvalidTransition, "Event '#{name}' cannot transition from '#{obj.aasm_current_state}'" if transitions.size == 0
    +
    +    next_state = nil
    +    transitions.each do |transition|
    +      next if to_state and !Array(transition.to).include?(to_state)
    +      if transition.perform(obj)
    +        next_state = to_state || Array(transition.to).first
    +        transition.execute(obj, *args)
    +        break
    +      end
    +    end
    +    next_state
    +  end
    +
    +
    + +
    + +
    +
    + + transitions_from_state(state) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 30
    +  def transitions_from_state(state)
    +    @transitions.select { |t| t.from == state }
    +  end
    +
    +
    + +
    + +
    +
    + + transitions_from_state?(state) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 26
    +  def transitions_from_state?(state)
    +    @transitions.any? { |t| t.from == state }
    +  end
    +
    +
    + +
    + +
    +
    + + update(options = {}, &block) + +
    + + + + +
    + +
    +
    # File lib/aasm/event.rb, line 53
    +  def update(options = {}, &block)
    +    if options.key?(:success) then
    +      @success = options[:success]
    +    end
    +    if options.key?(:error) then
    +      @error = options[:error]
    +    end
    +    if block then
    +      instance_eval(&block)
    +    end
    +    @options = options
    +    self
    +  end
    diff --git a/classes/AASM/SupportingClasses/State.html b/classes/AASM/SupportingClasses/State.html index 0f1a450..21e9170 100644 --- a/classes/AASM/SupportingClasses/State.html +++ b/classes/AASM/SupportingClasses/State.html @@ -49,7 +49,7 @@
    @@ -58,7 +58,7 @@
    @@ -67,7 +67,7 @@
    @@ -76,7 +76,7 @@
    @@ -85,7 +85,7 @@
    @@ -94,7 +94,7 @@
    @@ -136,101 +136,10 @@
    Class Public methods
    -
    -
    - - new(name, options={}) - -
    - - - - -
    - -
    -
    # File lib/aasm/state.rb, line 6
    -      def initialize(name, options={})
    -        @name = name
    -        update(options)
    -      end
    -
    -
    - -
    - -
    Instance Public methods
    - -
    -
    - - ==(state) - -
    - - - - -
    - -
    -
    # File lib/aasm/state.rb, line 11
    -      def ==(state)
    -        if state.is_a? Symbol
    -          name == state
    -        else
    -          name == state.name
    -        end
    -      end
    -
    -
    - -
    - -
    -
    - - call_action(action, record) - -
    - - - - -
    - -
    -
    # File lib/aasm/state.rb, line 19
    -      def call_action(action, record)
    -        action = @options[action]
    -        action.is_a?(Array) ?
    -                action.each {|a| _call_action(a, record)} :
    -                _call_action(action, record)
    -      end
    -
    -
    - -
    -
    - display_name() + new(name, options={})
    @@ -241,23 +150,26 @@
    -
    # File lib/aasm/state.rb, line 26
    -      def display_name
    -        @display_name ||= name.to_s.gsub(/_/, ' ').capitalize
    -      end
    +
    # File lib/aasm/state.rb, line 4
    +  def initialize(name, options={})
    +    @name = name
    +    update(options)
    +  end
    +
    Instance Public methods
    +
    - for_select() + ==(state)
    @@ -268,14 +180,50 @@
    -
    # File lib/aasm/state.rb, line 30
    -      def for_select
    -        [display_name, name.to_s]
    -      end
    +
    # File lib/aasm/state.rb, line 9
    +  def ==(state)
    +    if state.is_a? Symbol
    +      name == state
    +    else
    +      name == state.name
    +    end
    +  end
    +
    +
    + +
    + +
    +
    + + call_action(action, record) + +
    + + + + +
    + +
    +
    # File lib/aasm/state.rb, line 17
    +  def call_action(action, record)
    +    action = @options[action]
    +    catch :halt_aasm_chain do
    +      action.is_a?(Array) ?
    +              action.each {|a| _call_action(a, record)} :
    +              _call_action(action, record)
    +    end
    +  end
    @@ -284,7 +232,7 @@
    - update(options = {}) + display_name()
    @@ -295,18 +243,72 @@
    +
    # File lib/aasm/state.rb, line 26
    +  def display_name
    +    @display_name ||= name.to_s.gsub(/_/, ' ').capitalize
    +  end
    +
    +
    + +
    + +
    +
    + + for_select() + +
    + + + + +
    + +
    +
    # File lib/aasm/state.rb, line 30
    +  def for_select
    +    [display_name, name.to_s]
    +  end
    +
    +
    + +
    + +
    +
    + + update(options = {}) + +
    + + + + +
    + +
    # File lib/aasm/state.rb, line 34
    -      def update(options = {})
    -        if options.key?(:display) then
    -          @display_name = options.delete(:display)
    -        end
    -        @options = options
    -        self
    -      end
    + def update(options = {}) + if options.key?(:display) then + @display_name = options.delete(:display) + end + @options = options + self + end
    diff --git a/classes/AASM/SupportingClasses/StateTransition.html b/classes/AASM/SupportingClasses/StateTransition.html index f5234c0..1ac52d6 100644 --- a/classes/AASM/SupportingClasses/StateTransition.html +++ b/classes/AASM/SupportingClasses/StateTransition.html @@ -49,7 +49,7 @@
    @@ -67,7 +67,7 @@
    @@ -149,15 +149,15 @@
    -
    # File lib/aasm/state_transition.rb, line 7
    -      def initialize(opts)
    -        @from, @to, @guard, @on_transition = opts[:from], opts[:to], opts[:guard], opts[:on_transition]
    -        @opts = opts
    -      end
    +
    # File lib/aasm/state_transition.rb, line 5
    +  def initialize(opts)
    +    @from, @to, @guard, @on_transition = opts[:from], opts[:to], opts[:guard], opts[:on_transition]
    +    @opts = opts
    +  end
    @@ -166,9 +166,9 @@
    Instance Public methods
    -
    +
    - ==(obj) + ==(obj)
    @@ -177,16 +177,16 @@
    -
    -
    # File lib/aasm/state_transition.rb, line 29
    -      def ==(obj)
    -        @from == obj.from && @to == obj.to
    -      end
    +
    +
    # File lib/aasm/state_transition.rb, line 27
    +  def ==(obj)
    +    @from == obj.from && @to == obj.to
    +  end
    @@ -206,25 +206,25 @@
    -
    # File lib/aasm/state_transition.rb, line 23
    -      def execute(obj, *args)
    -        @on_transition.is_a?(Array) ?
    -                @on_transition.each {|ot| _execute(obj, ot, *args)} :
    -                _execute(obj, @on_transition, *args)
    -      end
    +
    # File lib/aasm/state_transition.rb, line 21
    +  def execute(obj, *args)
    +    @on_transition.is_a?(Array) ?
    +            @on_transition.each {|ot| _execute(obj, ot, *args)} :
    +            _execute(obj, @on_transition, *args)
    +  end
    -
    +
    - from?(value) + from?(value)
    @@ -233,16 +233,16 @@
    -
    -
    # File lib/aasm/state_transition.rb, line 33
    -      def from?(value)
    -        @from == value
    -      end
    +
    +
    # File lib/aasm/state_transition.rb, line 31
    +  def from?(value)
    +    @from == value
    +  end
    @@ -262,21 +262,21 @@
    -
    # File lib/aasm/state_transition.rb, line 12
    -      def perform(obj)
    -        case @guard
    -          when Symbol, String
    -            obj.send(@guard)
    -          when Proc
    -            @guard.call(obj)
    -          else
    -            true
    -        end
    -      end
    +
    # File lib/aasm/state_transition.rb, line 10
    +  def perform(obj)
    +    case @guard
    +      when Symbol, String
    +        obj.send(@guard)
    +      when Proc
    +        @guard.call(obj)
    +      else
    +        true
    +    end
    +  end
    diff --git a/created.rid b/created.rid index 1337e84..1a20a4e 100644 --- a/created.rid +++ b/created.rid @@ -1 +1 @@ -Fri, 23 Oct 2009 16:40:51 -0400 +Sun, 17 Jan 2010 01:33:48 -0500 diff --git a/css/main.css b/css/main.css index e220938..4b403ad 100755 --- a/css/main.css +++ b/css/main.css @@ -47,6 +47,21 @@ h4 { font-size: 1em; } +table +{ + margin-bottom: 1em; +} + +td, th +{ + padding: 0 0.7em 0.3em 0; +} + +th +{ + font-weight: bold; +} + .clear { clear: both; diff --git a/files/README_rdoc.html b/files/README_rdoc.html index b31a568..04454e9 100644 --- a/files/README_rdoc.html +++ b/files/README_rdoc.html @@ -19,7 +19,7 @@
    • README.rdoc
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:17:01 -0500 2010
    @@ -100,7 +100,8 @@ href="http://github.com/rubyist/aasm/tree/master">github.com/rubyist/aasm/tree/m

    Building your own gems

    -  % rake gem
    +  % rake gemspec
    +  % rake build
       % sudo gem install pkg/aasm-2.1.gem
     

    Simple Example

    @@ -111,6 +112,8 @@ Here’s a quick example highlighting some of the features. class Conversation include AASM + aasm_column :current_state # defaults to aasm_state + aasm_initial_state :unread aasm_state :unread @@ -134,6 +137,8 @@ This example uses a few of the more complex features available. class Relationship include AASM + aasm_column :status + aasm_initial_state Proc.new { |relationship| relationship.strictly_for_fun? ? :intimate : :dating } aasm_state :dating, :enter => :make_happy, :exit => :make_depressed diff --git a/files/lib/aasm/aasm_rb.html b/files/lib/aasm/aasm_rb.html index bc4fbe8..d0cca77 100644 --- a/files/lib/aasm/aasm_rb.html +++ b/files/lib/aasm/aasm_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/aasm.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:31:37 -0500 2010
    diff --git a/files/lib/aasm/event_rb.html b/files/lib/aasm/event_rb.html index fceaa3a..17dd6b9 100644 --- a/files/lib/aasm/event_rb.html +++ b/files/lib/aasm/event_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/event.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:31:37 -0500 2010
    @@ -40,13 +40,6 @@ -
    Classes and Modules
    -
      - -
    • MODULE AASM
    • - -
    - diff --git a/files/lib/aasm/persistence/active_record_persistence_rb.html b/files/lib/aasm/persistence/active_record_persistence_rb.html index aa4bf6f..a5d4e65 100644 --- a/files/lib/aasm/persistence/active_record_persistence_rb.html +++ b/files/lib/aasm/persistence/active_record_persistence_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/persistence/active_record_persistence.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Fri Oct 23 16:43:49 -0400 2009
    diff --git a/files/lib/aasm/persistence_rb.html b/files/lib/aasm/persistence_rb.html index e2a3cec..a7ab7ec 100644 --- a/files/lib/aasm/persistence_rb.html +++ b/files/lib/aasm/persistence_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/persistence.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:17:01 -0500 2010
    @@ -40,13 +40,6 @@ -
    Classes and Modules
    -
      - -
    • MODULE AASM
    • - -
    - diff --git a/files/lib/aasm/state_machine_rb.html b/files/lib/aasm/state_machine_rb.html index bdc6d35..b626628 100644 --- a/files/lib/aasm/state_machine_rb.html +++ b/files/lib/aasm/state_machine_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/state_machine.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:17:01 -0500 2010
    @@ -28,13 +28,6 @@ -
    Required Files
    -
      - -
    • ostruct
    • - -
    - @@ -47,13 +40,6 @@ -
    Classes and Modules
    -
      - -
    • MODULE AASM
    • - -
    - diff --git a/files/lib/aasm/state_rb.html b/files/lib/aasm/state_rb.html index 4479f66..2853c3c 100644 --- a/files/lib/aasm/state_rb.html +++ b/files/lib/aasm/state_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/state.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:31:37 -0500 2010
    @@ -40,13 +40,6 @@ -
    Classes and Modules
    -
      - -
    • MODULE AASM
    • - -
    - diff --git a/files/lib/aasm/state_transition_rb.html b/files/lib/aasm/state_transition_rb.html index 6354d02..e9c26be 100644 --- a/files/lib/aasm/state_transition_rb.html +++ b/files/lib/aasm/state_transition_rb.html @@ -19,7 +19,7 @@
    • lib/aasm/state_transition.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:17:01 -0500 2010
    @@ -40,13 +40,6 @@ -
    Classes and Modules
    -
      - -
    • MODULE AASM
    • - -
    - diff --git a/files/lib/aasm/supporting_classes_rb.html b/files/lib/aasm/supporting_classes_rb.html new file mode 100644 index 0000000..09b9263 --- /dev/null +++ b/files/lib/aasm/supporting_classes_rb.html @@ -0,0 +1,52 @@ + + + + + supporting_classes.rb + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    +
    + + \ No newline at end of file diff --git a/files/lib/aasm_rb.html b/files/lib/aasm_rb.html index f4938e2..4927967 100644 --- a/files/lib/aasm_rb.html +++ b/files/lib/aasm_rb.html @@ -19,7 +19,7 @@
    • lib/aasm.rb
    • -
    • Last modified: Fri Oct 23 16:40:42 -0400 2009
    • +
    • Last modified: Sun Jan 17 01:17:01 -0500 2010
    @@ -28,6 +28,13 @@ +
    Required Files
    +
      + +
    • ostruct
    • + +
    + @@ -40,6 +47,13 @@ +
    Classes and Modules
    +
      + +
    • MODULE AASM
    • + +
    + diff --git a/index.html b/index.html index 266ea3d..16b9f30 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - aasm 2.1.3 + <title>aasm 2.1.4 diff --git a/panel/search_index.js b/panel/search_index.js index 587626d..b04f488 100644 --- a/panel/search_index.js +++ b/panel/search_index.js @@ -1 +1 @@ -var search_data = {"index":{"info":[["AASM","lib/aasm/state_transition.rb","classes/AASM.html"," < ","",1],["ClassMethods","AASM","classes/AASM/ClassMethods.html"," < ","",1],["InvalidTransition","AASM","classes/AASM/InvalidTransition.html"," < RuntimeError","",1],["Persistence","AASM","classes/AASM/Persistence.html"," < ","",1],["ActiveRecordPersistence","AASM::Persistence","classes/AASM/Persistence/ActiveRecordPersistence.html"," < ","",1],["ClassMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html"," < ","",1],["InstanceMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html"," < ","",1],["NamedScopeMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html"," < ","",1],["ReadState","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html"," < ","",1],["WriteState","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html"," < ","",1],["WriteStateWithoutPersistence","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html"," < ","",1],["StateMachine","AASM","classes/AASM/StateMachine.html"," < Object","",1],["SupportingClasses","AASM","classes/AASM/SupportingClasses.html"," < ","",1],["Event","AASM::SupportingClasses","classes/AASM/SupportingClasses/Event.html"," < Object","",1],["State","AASM::SupportingClasses","classes/AASM/SupportingClasses/State.html"," < Object","",1],["StateTransition","AASM::SupportingClasses","classes/AASM/SupportingClasses/StateTransition.html"," < Object","",1],["UndefinedState","AASM","classes/AASM/UndefinedState.html"," < RuntimeError","",1],["==","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000020","(event)","",2],["==","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000039","(state)","",2],["==","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000057","(obj)","",2],["[]","AASM::StateMachine","classes/AASM/StateMachine.html#M000049","(*args)","",2],["[]=","AASM::StateMachine","classes/AASM/StateMachine.html#M000050","(*args)","",2],["aasm_column","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000031","(column_name=nil)","Maps to the aasm_column in the database. Deafults to \"aasm_state\". You can write: create_table :foos",2],["aasm_current_state","AASM","classes/AASM.html#M000011","()","Instance methods ",2],["aasm_current_state","AASM::Persistence::ActiveRecordPersistence::InstanceMethods","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html#M000037","()","Returns the current aasm_state of the object. Respects reload and any changes made to the aasm_state",2],["aasm_enter_initial_state","AASM","classes/AASM.html#M000012","()","",2],["aasm_event","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000005","(name, options = {}, &block)","",2],["aasm_events","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000007","()","",2],["aasm_events_for_current_state","AASM","classes/AASM.html#M000015","()","",2],["aasm_events_for_state","AASM","classes/AASM.html#M000016","(state)","",2],["aasm_initial_state","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000002","(set_state=nil)","",2],["aasm_initial_state=","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000003","(state)","",2],["aasm_read_state","AASM::Persistence::ActiveRecordPersistence::ReadState","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html#M000047","()","Returns the value of the aasm_column - called from aasm_current_state If it's a new record,",2],["aasm_state","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000004","(name, options={})","",2],["aasm_state_with_named_scope","AASM::Persistence::ActiveRecordPersistence::NamedScopeMethods","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html#M000048","(name, options = {})","",2],["aasm_states","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000006","()","",2],["aasm_states_for_select","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000008","()","",2],["aasm_write_state","AASM::Persistence::ActiveRecordPersistence::WriteState","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html#M000044","(state)","Writes state to the state column and persists it to the database using update_attribute (which",2],["aasm_write_state_without_persistence","AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html#M000043","(state)","Writes state to the state column, but does not persist it to the database foo = Foo.find(1)",2],["all_transitions","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000018","()","",2],["calculate_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000034","(state, *args)","",2],["call_action","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000019","(action, record)","",2],["call_action","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000040","(action, record)","",2],["clone","AASM::StateMachine","classes/AASM/StateMachine.html#M000052","()","",2],["count_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000033","(state, *args)","",2],["create_state","AASM::StateMachine","classes/AASM/StateMachine.html#M000053","(name, options)","",2],["display_name","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000041","()","",2],["execute","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000056","(obj, *args)","",2],["execute_success_callback","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000025","(obj, success = nil)","",2],["find_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000032","(number, state, *args)","",2],["fire","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000010","(obj, to_state=nil, *args)","",2],["for_select","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000042","()","",2],["from?","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000058","(value)","",2],["included","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence.html#M000029","(base)","This method: * extends the model with ClassMethods * includes InstanceMethods Unless the corresponding",2],["inherited","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000001","(klass)","",2],["new","AASM::StateMachine","classes/AASM/StateMachine.html#M000051","(name)","",2],["new","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000009","(name, options = {}, &block)","",2],["new","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000036","(name, options={})","",2],["new","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000054","(opts)","",2],["perform","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000055","(obj)","",2],["set_persistence","AASM::Persistence","classes/AASM/Persistence.html#M000030","(base)","Checks to see this class or any of it's superclasses inherit from ActiveRecord::Base and if so includes",2],["transitions_from_state","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000014","(state)","",2],["transitions_from_state?","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000013","(state)","",2],["update","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000021","(options = {}, &block)","",2],["update","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000045","(options = {})","",2],["with_state_scope","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000035","(state)","",2],["README.rdoc","files/README_rdoc.html","files/README_rdoc.html","","= AASM - Ruby state machines This package contains AASM, a library for adding finite state machines",3],["aasm.rb","files/lib/aasm_rb.html","files/lib/aasm_rb.html","","",3],["aasm.rb","files/lib/aasm/aasm_rb.html","files/lib/aasm/aasm_rb.html","","",3],["event.rb","files/lib/aasm/event_rb.html","files/lib/aasm/event_rb.html","","",3],["persistence.rb","files/lib/aasm/persistence_rb.html","files/lib/aasm/persistence_rb.html","","",3],["active_record_persistence.rb","files/lib/aasm/persistence/active_record_persistence_rb.html","files/lib/aasm/persistence/active_record_persistence_rb.html","","",3],["state.rb","files/lib/aasm/state_rb.html","files/lib/aasm/state_rb.html","","",3],["state_machine.rb","files/lib/aasm/state_machine_rb.html","files/lib/aasm/state_machine_rb.html","","",3],["state_transition.rb","files/lib/aasm/state_transition_rb.html","files/lib/aasm/state_transition_rb.html","","",3]],"searchIndex":["aasm","classmethods","invalidtransition","persistence","activerecordpersistence","classmethods","instancemethods","namedscopemethods","readstate","writestate","writestatewithoutpersistence","statemachine","supportingclasses","event","state","statetransition","undefinedstate","==()","==()","==()","[]()","[]=()","aasm_column()","aasm_current_state()","aasm_current_state()","aasm_enter_initial_state()","aasm_event()","aasm_events()","aasm_events_for_current_state()","aasm_events_for_state()","aasm_initial_state()","aasm_initial_state=()","aasm_read_state()","aasm_state()","aasm_state_with_named_scope()","aasm_states()","aasm_states_for_select()","aasm_write_state()","aasm_write_state_without_persistence()","all_transitions()","calculate_in_state()","call_action()","call_action()","clone()","count_in_state()","create_state()","display_name()","execute()","execute_success_callback()","find_in_state()","fire()","for_select()","from?()","included()","inherited()","new()","new()","new()","new()","perform()","set_persistence()","transitions_from_state()","transitions_from_state?()","update()","update()","with_state_scope()","readme.rdoc","aasm.rb","aasm.rb","event.rb","persistence.rb","active_record_persistence.rb","state.rb","state_machine.rb","state_transition.rb"],"longSearchIndex":["lib/aasm/state_transition.rb","aasm","aasm","aasm","aasm::persistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm","aasm","aasm::supportingclasses","aasm::supportingclasses","aasm::supportingclasses","aasm","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::statemachine","aasm::statemachine","aasm::persistence::activerecordpersistence::classmethods","aasm","aasm::persistence::activerecordpersistence::instancemethods","aasm","aasm::classmethods","aasm::classmethods","aasm","aasm","aasm::classmethods","aasm::classmethods","aasm::persistence::activerecordpersistence::readstate","aasm::classmethods","aasm::persistence::activerecordpersistence::namedscopemethods","aasm::classmethods","aasm::classmethods","aasm::persistence::activerecordpersistence::writestate","aasm::persistence::activerecordpersistence::writestatewithoutpersistence","aasm::supportingclasses::event","aasm::persistence::activerecordpersistence::classmethods","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::statemachine","aasm::persistence::activerecordpersistence::classmethods","aasm::statemachine","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::supportingclasses::event","aasm::persistence::activerecordpersistence::classmethods","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::persistence::activerecordpersistence","aasm::classmethods","aasm::statemachine","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::supportingclasses::statetransition","aasm::persistence","aasm::supportingclasses::event","aasm::supportingclasses::event","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::persistence::activerecordpersistence::classmethods","files/readme_rdoc.html","files/lib/aasm_rb.html","files/lib/aasm/aasm_rb.html","files/lib/aasm/event_rb.html","files/lib/aasm/persistence_rb.html","files/lib/aasm/persistence/active_record_persistence_rb.html","files/lib/aasm/state_rb.html","files/lib/aasm/state_machine_rb.html","files/lib/aasm/state_transition_rb.html"]}} \ No newline at end of file +var search_data = {"index":{"searchIndex":["aasm","classmethods","invalidtransition","persistence","activerecordpersistence","classmethods","instancemethods","namedscopemethods","readstate","writestate","writestatewithoutpersistence","statemachine","supportingclasses","event","state","statetransition","undefinedstate","==()","==()","==()","[]()","[]=()","aasm_column()","aasm_current_state()","aasm_current_state()","aasm_enter_initial_state()","aasm_event()","aasm_events()","aasm_events_for_current_state()","aasm_events_for_state()","aasm_initial_state()","aasm_initial_state=()","aasm_read_state()","aasm_state()","aasm_state_with_named_scope()","aasm_states()","aasm_states_for_select()","aasm_write_state()","aasm_write_state_without_persistence()","all_transitions()","calculate_in_state()","call_action()","call_action()","clone()","count_in_state()","create_state()","display_name()","execute()","execute_error_callback()","execute_success_callback()","find_in_state()","fire()","for_select()","from?()","included()","inherited()","new()","new()","new()","new()","perform()","set_persistence()","transitions_from_state()","transitions_from_state?()","update()","update()","with_state_scope()","readme.rdoc","aasm.rb","aasm.rb","event.rb","persistence.rb","active_record_persistence.rb","state.rb","state_machine.rb","state_transition.rb","supporting_classes.rb"],"longSearchIndex":["lib/aasm.rb","aasm","aasm","aasm","aasm::persistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm::persistence::activerecordpersistence","aasm","aasm","aasm::supportingclasses","aasm::supportingclasses","aasm::supportingclasses","aasm","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::statemachine","aasm::statemachine","aasm::persistence::activerecordpersistence::classmethods","aasm","aasm::persistence::activerecordpersistence::instancemethods","aasm","aasm::classmethods","aasm::classmethods","aasm","aasm","aasm::classmethods","aasm::classmethods","aasm::persistence::activerecordpersistence::readstate","aasm::classmethods","aasm::persistence::activerecordpersistence::namedscopemethods","aasm::classmethods","aasm::classmethods","aasm::persistence::activerecordpersistence::writestate","aasm::persistence::activerecordpersistence::writestatewithoutpersistence","aasm::supportingclasses::event","aasm::persistence::activerecordpersistence::classmethods","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::statemachine","aasm::persistence::activerecordpersistence::classmethods","aasm::statemachine","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::supportingclasses::event","aasm::supportingclasses::event","aasm::persistence::activerecordpersistence::classmethods","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::persistence::activerecordpersistence","aasm::classmethods","aasm::statemachine","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::supportingclasses::statetransition","aasm::supportingclasses::statetransition","aasm::persistence","aasm::supportingclasses::event","aasm::supportingclasses::event","aasm::supportingclasses::event","aasm::supportingclasses::state","aasm::persistence::activerecordpersistence::classmethods","files/readme_rdoc.html","files/lib/aasm_rb.html","files/lib/aasm/aasm_rb.html","files/lib/aasm/event_rb.html","files/lib/aasm/persistence_rb.html","files/lib/aasm/persistence/active_record_persistence_rb.html","files/lib/aasm/state_rb.html","files/lib/aasm/state_machine_rb.html","files/lib/aasm/state_transition_rb.html","files/lib/aasm/supporting_classes_rb.html"],"info":[["AASM","lib/aasm/aasm.rb","classes/AASM.html"," < ","",1],["ClassMethods","AASM","classes/AASM/ClassMethods.html"," < ","",1],["InvalidTransition","AASM","classes/AASM/InvalidTransition.html"," < RuntimeError","",1],["Persistence","AASM","classes/AASM/Persistence.html"," < ","",1],["ActiveRecordPersistence","AASM::Persistence","classes/AASM/Persistence/ActiveRecordPersistence.html"," < ","",1],["ClassMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html"," < ","",1],["InstanceMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html"," < ","",1],["NamedScopeMethods","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html"," < ","",1],["ReadState","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html"," < ","",1],["WriteState","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html"," < ","",1],["WriteStateWithoutPersistence","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html"," < ","",1],["StateMachine","AASM","classes/AASM/StateMachine.html"," < Object","",1],["SupportingClasses","AASM","classes/AASM/SupportingClasses.html"," < ","",1],["Event","AASM::SupportingClasses","classes/AASM/SupportingClasses/Event.html"," < Object","",1],["State","AASM::SupportingClasses","classes/AASM/SupportingClasses/State.html"," < Object","",1],["StateTransition","AASM::SupportingClasses","classes/AASM/SupportingClasses/StateTransition.html"," < Object","",1],["UndefinedState","AASM","classes/AASM/UndefinedState.html"," < RuntimeError","",1],["==","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000024","(event)","",2],["==","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000042","(state)","",2],["==","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000058","(obj)","",2],["[]","AASM::StateMachine","classes/AASM/StateMachine.html#M000050","(*args)","",2],["[]=","AASM::StateMachine","classes/AASM/StateMachine.html#M000051","(*args)","",2],["aasm_column","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000032","(column_name=nil)","Maps to the aasm_column in the database. Deafults to \"aasm_state\". You can write: create_table :foos",2],["aasm_current_state","AASM","classes/AASM.html#M000009","()","Instance methods ",2],["aasm_current_state","AASM::Persistence::ActiveRecordPersistence::InstanceMethods","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html#M000037","()","Returns the current aasm_state of the object. Respects reload and any changes made to the aasm_state",2],["aasm_enter_initial_state","AASM","classes/AASM.html#M000010","()","",2],["aasm_event","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000005","(name, options = {}, &block)","",2],["aasm_events","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000007","()","",2],["aasm_events_for_current_state","AASM","classes/AASM.html#M000011","()","",2],["aasm_events_for_state","AASM","classes/AASM.html#M000012","(state)","",2],["aasm_initial_state","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000002","(set_state=nil)","",2],["aasm_initial_state=","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000003","(state)","",2],["aasm_read_state","AASM::Persistence::ActiveRecordPersistence::ReadState","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html#M000044","()","Returns the value of the aasm_column - called from aasm_current_state If it's a new record,",2],["aasm_state","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000004","(name, options={})","",2],["aasm_state_with_named_scope","AASM::Persistence::ActiveRecordPersistence::NamedScopeMethods","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html#M000049","(name, options = {})","",2],["aasm_states","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000006","()","",2],["aasm_states_for_select","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000008","()","",2],["aasm_write_state","AASM::Persistence::ActiveRecordPersistence::WriteState","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html#M000040","(state)","Writes state to the state column and persists it to the database using update_attribute (which",2],["aasm_write_state_without_persistence","AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html#M000039","(state)","Writes state to the state column, but does not persist it to the database foo = Foo.find(1)",2],["all_transitions","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000020","()","",2],["calculate_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000035","(state, *args)","",2],["call_action","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000021","(action, record)","",2],["call_action","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000043","(action, record)","",2],["clone","AASM::StateMachine","classes/AASM/StateMachine.html#M000053","()","",2],["count_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000034","(state, *args)","",2],["create_state","AASM::StateMachine","classes/AASM/StateMachine.html#M000057","(name, options)","",2],["display_name","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000045","()","",2],["execute","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000056","(obj, *args)","",2],["execute_error_callback","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000027","(obj, error, error_callback=nil)","",2],["execute_success_callback","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000026","(obj, success = nil)","",2],["find_in_state","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000033","(number, state, *args)","",2],["fire","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000015","(obj, to_state=nil, *args)","",2],["for_select","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000046","()","",2],["from?","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000059","(value)","",2],["included","AASM::Persistence::ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence.html#M000031","(base)","This method: * extends the model with ClassMethods * includes InstanceMethods Unless the corresponding",2],["inherited","AASM::ClassMethods","classes/AASM/ClassMethods.html#M000001","(klass)","",2],["new","AASM::StateMachine","classes/AASM/StateMachine.html#M000052","(name)","",2],["new","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000014","(name, options = {}, &block)","",2],["new","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000041","(name, options={})","",2],["new","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000054","(opts)","",2],["perform","AASM::SupportingClasses::StateTransition","classes/AASM/SupportingClasses/StateTransition.html#M000055","(obj)","",2],["set_persistence","AASM::Persistence","classes/AASM/Persistence.html#M000030","(base)","Checks to see this class or any of it's superclasses inherit from ActiveRecord::Base and if so includes",2],["transitions_from_state","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000019","(state)","",2],["transitions_from_state?","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000018","(state)","",2],["update","AASM::SupportingClasses::Event","classes/AASM/SupportingClasses/Event.html#M000025","(options = {}, &block)","",2],["update","AASM::SupportingClasses::State","classes/AASM/SupportingClasses/State.html#M000047","(options = {})","",2],["with_state_scope","AASM::Persistence::ActiveRecordPersistence::ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html#M000036","(state)","",2],["README.rdoc","files/README_rdoc.html","files/README_rdoc.html","","= AASM - Ruby state machines This package contains AASM, a library for adding finite state machines",3],["aasm.rb","files/lib/aasm_rb.html","files/lib/aasm_rb.html","","",3],["aasm.rb","files/lib/aasm/aasm_rb.html","files/lib/aasm/aasm_rb.html","","",3],["event.rb","files/lib/aasm/event_rb.html","files/lib/aasm/event_rb.html","","",3],["persistence.rb","files/lib/aasm/persistence_rb.html","files/lib/aasm/persistence_rb.html","","",3],["active_record_persistence.rb","files/lib/aasm/persistence/active_record_persistence_rb.html","files/lib/aasm/persistence/active_record_persistence_rb.html","","",3],["state.rb","files/lib/aasm/state_rb.html","files/lib/aasm/state_rb.html","","",3],["state_machine.rb","files/lib/aasm/state_machine_rb.html","files/lib/aasm/state_machine_rb.html","","",3],["state_transition.rb","files/lib/aasm/state_transition_rb.html","files/lib/aasm/state_transition_rb.html","","",3],["supporting_classes.rb","files/lib/aasm/supporting_classes_rb.html","files/lib/aasm/supporting_classes_rb.html","","",3]]}} \ No newline at end of file diff --git a/panel/tree.js b/panel/tree.js index 689382a..50154d0 100644 --- a/panel/tree.js +++ b/panel/tree.js @@ -1 +1 @@ -var tree = [["","","files",[["README.rdoc","files/README_rdoc.html","",[]],["","","lib",[["","","aasm",[["aasm.rb","files/lib/aasm/aasm_rb.html","",[]],["event.rb","files/lib/aasm/event_rb.html","",[]],["","","persistence",[["active_record_persistence.rb","files/lib/aasm/persistence/active_record_persistence_rb.html","",[]]]],["persistence.rb","files/lib/aasm/persistence_rb.html","",[]],["state.rb","files/lib/aasm/state_rb.html","",[]],["state_machine.rb","files/lib/aasm/state_machine_rb.html","",[]],["state_transition.rb","files/lib/aasm/state_transition_rb.html","",[]]]],["aasm.rb","files/lib/aasm_rb.html","",[]]]]]],["AASM","classes/AASM.html","",[["ClassMethods","classes/AASM/ClassMethods.html","",[]],["InvalidTransition","classes/AASM/InvalidTransition.html"," < RuntimeError",[]],["Persistence","classes/AASM/Persistence.html","",[["ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence.html","",[["ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html","",[]],["InstanceMethods","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html","",[]],["NamedScopeMethods","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html","",[]],["ReadState","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html","",[]],["WriteState","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html","",[]],["WriteStateWithoutPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html","",[]]]]]],["StateMachine","classes/AASM/StateMachine.html"," < Object",[]],["SupportingClasses","classes/AASM/SupportingClasses.html","",[["Event","classes/AASM/SupportingClasses/Event.html"," < Object",[]],["State","classes/AASM/SupportingClasses/State.html"," < Object",[]],["StateTransition","classes/AASM/SupportingClasses/StateTransition.html"," < Object",[]]]],["UndefinedState","classes/AASM/UndefinedState.html"," < RuntimeError",[]]]]] \ No newline at end of file +var tree = [["","","files",[["README.rdoc","files/README_rdoc.html","",[]],["","","lib",[["","","aasm",[["aasm.rb","files/lib/aasm/aasm_rb.html","",[]],["event.rb","files/lib/aasm/event_rb.html","",[]],["","","persistence",[["active_record_persistence.rb","files/lib/aasm/persistence/active_record_persistence_rb.html","",[]]]],["persistence.rb","files/lib/aasm/persistence_rb.html","",[]],["state.rb","files/lib/aasm/state_rb.html","",[]],["state_machine.rb","files/lib/aasm/state_machine_rb.html","",[]],["state_transition.rb","files/lib/aasm/state_transition_rb.html","",[]],["supporting_classes.rb","files/lib/aasm/supporting_classes_rb.html","",[]]]],["aasm.rb","files/lib/aasm_rb.html","",[]]]]]],["AASM","classes/AASM.html","",[["ClassMethods","classes/AASM/ClassMethods.html","",[]],["InvalidTransition","classes/AASM/InvalidTransition.html"," < RuntimeError",[]],["Persistence","classes/AASM/Persistence.html","",[["ActiveRecordPersistence","classes/AASM/Persistence/ActiveRecordPersistence.html","",[["ClassMethods","classes/AASM/Persistence/ActiveRecordPersistence/ClassMethods.html","",[]],["InstanceMethods","classes/AASM/Persistence/ActiveRecordPersistence/InstanceMethods.html","",[]],["NamedScopeMethods","classes/AASM/Persistence/ActiveRecordPersistence/NamedScopeMethods.html","",[]],["ReadState","classes/AASM/Persistence/ActiveRecordPersistence/ReadState.html","",[]],["WriteState","classes/AASM/Persistence/ActiveRecordPersistence/WriteState.html","",[]],["WriteStateWithoutPersistence","classes/AASM/Persistence/ActiveRecordPersistence/WriteStateWithoutPersistence.html","",[]]]]]],["StateMachine","classes/AASM/StateMachine.html"," < Object",[]],["SupportingClasses","classes/AASM/SupportingClasses.html","",[["Event","classes/AASM/SupportingClasses/Event.html"," < Object",[]],["State","classes/AASM/SupportingClasses/State.html"," < Object",[]],["StateTransition","classes/AASM/SupportingClasses/StateTransition.html"," < Object",[]]]],["UndefinedState","classes/AASM/UndefinedState.html"," < RuntimeError",[]]]]] \ No newline at end of file