Class: Statesman::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/statesman/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block = nil) ⇒ Config

Returns a new instance of Config.



10
11
12
# File 'lib/statesman/config.rb', line 10

def initialize(block = nil)
  instance_eval(&block) unless block.nil?
end

Instance Attribute Details

#adapter_classObject (readonly)

Returns the value of attribute adapter_class.



8
9
10
# File 'lib/statesman/config.rb', line 8

def adapter_class
  @adapter_class
end

Instance Method Details

#enable_mysql_gaplock_protectionObject



27
28
29
# File 'lib/statesman/config.rb', line 27

def enable_mysql_gaplock_protection
  @mysql_gaplock_protection = true
end

#mysql_gaplock_protection?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
24
25
# File 'lib/statesman/config.rb', line 18

def mysql_gaplock_protection?
  return @mysql_gaplock_protection unless @mysql_gaplock_protection.nil?

  # If our adapter class suggests we're using mysql, enable gaplock protection by
  # default.
  enable_mysql_gaplock_protection if mysql_adapter?(adapter_class)
  @mysql_gaplock_protection
end

#storage_adapter(adapter_class) ⇒ Object



14
15
16
# File 'lib/statesman/config.rb', line 14

def storage_adapter(adapter_class)
  @adapter_class = adapter_class
end