Class: SequelRails::Configuration
- Inherits:
-
Object
- Object
- SequelRails::Configuration
- Defined in:
- lib/sequel_rails/configuration.rb
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#migration_dir ⇒ Object
Returns the value of attribute migration_dir.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
18 19 20 |
# File 'lib/sequel_rails/configuration.rb', line 18 def logger @logger end |
#migration_dir ⇒ Object
Returns the value of attribute migration_dir.
19 20 21 |
# File 'lib/sequel_rails/configuration.rb', line 19 def migration_dir @migration_dir end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
17 18 19 |
# File 'lib/sequel_rails/configuration.rb', line 17 def raw @raw end |
#root ⇒ Object (readonly)
Returns the value of attribute root.
17 18 19 |
# File 'lib/sequel_rails/configuration.rb', line 17 def root @root end |
Class Method Details
.for(root, database_yml_hash) ⇒ Object
13 14 15 |
# File 'lib/sequel_rails/configuration.rb', line 13 def self.for(root, database_yml_hash) ::SequelRails.configuration ||= new(root, database_yml_hash) end |
Instance Method Details
#environment_for(name) ⇒ Object
21 22 23 |
# File 'lib/sequel_rails/configuration.rb', line 21 def environment_for(name) environments[name.to_s] || environments[name.to_sym] end |
#environments ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/sequel_rails/configuration.rb', line 25 def environments @environments ||= @raw.inject({}) do |normalized, environment| name, config = environment.first, environment.last normalized[name] = normalize_repository_config(config) normalized end end |