Class: QueryKit::Configuration
- Inherits:
-
Object
- Object
- QueryKit::Configuration
- Defined in:
- lib/querykit/configuration.rb
Overview
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#connection_options ⇒ Object
Returns the value of attribute connection_options.
Instance Method Summary collapse
-
#configured? ⇒ Boolean
Check if configuration is set.
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#setup(adapter, options = {}) ⇒ void
Configure with adapter and options.
-
#validate! ⇒ void
Validate configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 |
# File 'lib/querykit/configuration.rb', line 13 def initialize @adapter = nil @connection_options = {} end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
11 12 13 |
# File 'lib/querykit/configuration.rb', line 11 def adapter @adapter end |
#connection_options ⇒ Object
Returns the value of attribute connection_options.
11 12 13 |
# File 'lib/querykit/configuration.rb', line 11 def @connection_options end |
Instance Method Details
#configured? ⇒ Boolean
Check if configuration is set
31 32 33 |
# File 'lib/querykit/configuration.rb', line 31 def configured? !@adapter.nil? end |
#setup(adapter, options = {}) ⇒ void
This method returns an undefined value.
Configure with adapter and options
23 24 25 26 |
# File 'lib/querykit/configuration.rb', line 23 def setup(adapter, = {}) @adapter = adapter @connection_options = end |
#validate! ⇒ void
This method returns an undefined value.
Validate configuration
39 40 41 |
# File 'lib/querykit/configuration.rb', line 39 def validate! raise ConfigurationError, "QueryKit not configured. Call QueryKit.configure first." unless configured? end |