Class: Rails::Sequel::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/sequel-rails/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/sequel-rails/configuration.rb', line 16

def logger
  @logger
end

#migration_dirObject

Returns the value of attribute migration_dir.



17
18
19
# File 'lib/sequel-rails/configuration.rb', line 17

def migration_dir
  @migration_dir
end

#rawObject (readonly)

Returns the value of attribute raw.



15
16
17
# File 'lib/sequel-rails/configuration.rb', line 15

def raw
  @raw
end

#rootObject (readonly)

Returns the value of attribute root.



15
16
17
# File 'lib/sequel-rails/configuration.rb', line 15

def root
  @root
end

Class Method Details

.for(root, database_yml_hash) ⇒ Object



11
12
13
# File 'lib/sequel-rails/configuration.rb', line 11

def self.for(root, database_yml_hash)
  Rails::Sequel.configuration ||= new(root, database_yml_hash)
end

Instance Method Details

#environment_for(name) ⇒ Object



19
20
21
# File 'lib/sequel-rails/configuration.rb', line 19

def environment_for(name)
  environments[name.to_s] || environments[name.to_sym]
end

#environmentsObject



23
24
25
26
27
28
29
# File 'lib/sequel-rails/configuration.rb', line 23

def environments
  @environments ||= @raw.inject({}) do |normalized, environment|
    name, config = environment.first, environment.last
    normalized[name] = normalize_repository_config(config)
    normalized
  end
end