Class: Horza::Configuration
- Inherits:
-
Object
- Object
- Horza::Configuration
- Defined in:
- lib/horza/configuration.rb
Instance Attribute Summary collapse
-
#constant_paths ⇒ Object
Returns the value of attribute constant_paths.
Instance Method Summary collapse
- #adapter ⇒ Object
- #adapter=(name) ⇒ Object
- #clear_constant_paths ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/horza/configuration.rb', line 5 def initialize @constant_paths = [] end |
Instance Attribute Details
#constant_paths ⇒ Object
Returns the value of attribute constant_paths.
3 4 5 |
# File 'lib/horza/configuration.rb', line 3 def constant_paths @constant_paths end |
Instance Method Details
#adapter ⇒ Object
13 14 15 |
# File 'lib/horza/configuration.rb', line 13 def adapter @adapter || raise(::Horza::Errors::AdapterError.new("No adapter configured")) end |
#adapter=(name) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/horza/configuration.rb', line 17 def adapter=(name) @adapter = "Horza::Adapters::#{name.to_s.camelize}".constantize if name rescue NameError raise ::Horza::Errors::AdapterError.new("No adapter found for: #{name}") @adapter = nil end |
#clear_constant_paths ⇒ Object
9 10 11 |
# File 'lib/horza/configuration.rb', line 9 def clear_constant_paths constant_paths.clear end |