module Statesman

Add statesman attributes to a pre-existing transition class

Constants

VERSION

Public Class Methods

config() click to toggle source
# File lib/statesman.rb, line 41
def self.config
  @config ||= Config.new
end
configure(&block) click to toggle source

Example:

Statesman.configure do
  storage_adapter Statesman::ActiveRecordAdapter
  enable_mysql_gaplock_protection
end
# File lib/statesman.rb, line 26
def self.configure(&block)
  @config = Config.new(block)
  @storage_adapter = config.adapter_class
end
mysql_gaplock_protection?() click to toggle source
# File lib/statesman.rb, line 35
def self.mysql_gaplock_protection?
  return @mysql_gaplock_protection unless @mysql_gaplock_protection.nil?

  @mysql_gaplock_protection = config.mysql_gaplock_protection?
end
storage_adapter() click to toggle source
# File lib/statesman.rb, line 31
def self.storage_adapter
  @storage_adapter || Adapters::Memory
end