Class: Statesman::Config
- Inherits:
-
Object
- Object
- Statesman::Config
- Defined in:
- lib/statesman/config.rb
Instance Attribute Summary collapse
-
#adapter_class ⇒ Object
readonly
Returns the value of attribute adapter_class.
Instance Method Summary collapse
- #enable_mysql_gaplock_protection ⇒ Object
-
#initialize(block = nil) ⇒ Config
constructor
A new instance of Config.
- #mysql_gaplock_protection? ⇒ Boolean
- #storage_adapter(adapter_class) ⇒ Object
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_class ⇒ Object (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_protection ⇒ Object
27 28 29 |
# File 'lib/statesman/config.rb', line 27 def enable_mysql_gaplock_protection @mysql_gaplock_protection = true end |
#mysql_gaplock_protection? ⇒ 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 |