Class: FancyCount::Configuration

Inherits:
Object
  • Object
show all
Includes:
ActiveSupport::Configurable
Defined in:
lib/fancy_count/configuration.rb

Constant Summary collapse

ADAPTER_CLASSES =
{
  redis: FancyCount::RedisAdapter,
  test: FancyCount::TestAdapter
}

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.adapter=(value) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/fancy_count/configuration.rb', line 17

def self.adapter=(value)
  if ADAPTER_CLASSES.key?(value.to_sym)
    super(value)
  else
    raise_missing_adapter_error(value)
  end
end

Instance Method Details

#adapter_classObject



25
26
27
# File 'lib/fancy_count/configuration.rb', line 25

def adapter_class
  @adapter_class ||= ADAPTER_CLASSES[adapter.to_sym]
end