Class: Kweerie::Configuration
- Inherits:
-
Object
- Object
- Kweerie::Configuration
- Defined in:
- lib/kweerie/configuration.rb
Instance Attribute Summary collapse
-
#connection_provider ⇒ Object
Returns the value of attribute connection_provider.
-
#sql_paths ⇒ Object
Returns the value of attribute sql_paths.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/kweerie/configuration.rb', line 7 def initialize # Default to using ActiveRecord's connection if available @connection_provider = lambda { unless defined?(ActiveRecord::Base) raise ConfigurationError, "No connection provider configured and ActiveRecord is not available" end ActiveRecord::Base.connection.raw_connection } # Default SQL paths @sql_paths = lambda { paths = ["app/queries"] paths.unshift("lib/queries") unless defined?(Rails) paths } end |
Instance Attribute Details
#connection_provider ⇒ Object
Returns the value of attribute connection_provider.
5 6 7 |
# File 'lib/kweerie/configuration.rb', line 5 def connection_provider @connection_provider end |
#sql_paths ⇒ Object
Returns the value of attribute sql_paths.
5 6 7 |
# File 'lib/kweerie/configuration.rb', line 5 def sql_paths @sql_paths end |