Class: VinExploder::Configuration
- Inherits:
-
Object
- Object
- VinExploder::Configuration
- Defined in:
- lib/vin_exploder/configuration.rb
Instance Attribute Summary collapse
-
#adapter_options ⇒ Object
Returns the value of attribute adapter_options.
-
#cache_options ⇒ Object
Returns the value of attribute cache_options.
Instance Method Summary collapse
- #adapter(*args) ⇒ Object
- #cache_store(*args) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 |
# File 'lib/vin_exploder/configuration.rb', line 8 def initialize @cache_store = nil @cache_options = {} @adapter = nil @adapter_options = {} end |
Instance Attribute Details
#adapter_options ⇒ Object
Returns the value of attribute adapter_options.
6 7 8 |
# File 'lib/vin_exploder/configuration.rb', line 6 def @adapter_options end |
#cache_options ⇒ Object
Returns the value of attribute cache_options.
6 7 8 |
# File 'lib/vin_exploder/configuration.rb', line 6 def @cache_options end |
Instance Method Details
#adapter(*args) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/vin_exploder/configuration.rb', line 29 def adapter(*args) if args.empty? case @adapter when Symbol @adapter = VinExploder::Decode.const_get(@adapter.to_s.split('_').map{|s| s.capitalize }.join) else @adapter end else @adapter = args.shift @adapter_options = args.shift || {} end end |
#cache_store(*args) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vin_exploder/configuration.rb', line 15 def cache_store(*args) if args.empty? case @cache_store when Symbol @cache_store = VinExploder::Cache.const_get(@cache_store.to_s.split('_').map{|s| s.capitalize }.join) else @cache_store end else @cache_store = args.shift @cache_options = args.shift || {} end end |