Sha256: e42fe04a91fe848f726b548979754e3c4bb1f54057db420d7a35fc64d5a19300

Contents?: true

Size: 969 Bytes

Versions: 5

Compression:

Stored size: 969 Bytes

Contents

module Statesman
  autoload :Config,     "statesman/config"
  autoload :Machine,    "statesman/machine"
  autoload :Callback,   "statesman/callback"
  autoload :Guard,      "statesman/guard"
  autoload :Utils,      "statesman/utils"
  autoload :Version,    "statesman/version"
  module Adapters
    autoload :Memory,       "statesman/adapters/memory"
    autoload :ActiveRecord, "statesman/adapters/active_record"
    autoload :ActiveRecordTransition,
             "statesman/adapters/active_record_transition"
    autoload :ActiveRecordQueries,
             "statesman/adapters/active_record_queries"
  end
  require "statesman/railtie" if defined?(::Rails::Railtie)

  # Example:
  #   Statesman.configure do
  #     storage_adapter Statesman::ActiveRecordAdapter
  #   end
  #
  def self.configure(&block)
    config = Config.new(block)
    @storage_adapter = config.adapter_class
  end

  def self.storage_adapter
    @storage_adapter || Adapters::Memory
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
statesman-5.2.0 lib/statesman.rb
statesman-5.1.0 lib/statesman.rb
statesman-5.0.0 lib/statesman.rb
statesman-4.1.4 lib/statesman.rb
statesman-4.1.3 lib/statesman.rb