Class: PostPolicy::Config::Db
- Inherits:
-
Object
- Object
- PostPolicy::Config::Db
- Defined in:
- lib/postpolicy/config.rb
Class Attribute Summary collapse
-
.dbconfig ⇒ Object
readonly
Returns the value of attribute dbconfig.
-
.dbi_params ⇒ Object
readonly
Returns the value of attribute dbi_params.
Class Method Summary collapse
Class Attribute Details
.dbconfig ⇒ Object (readonly)
Returns the value of attribute dbconfig.
34 35 36 |
# File 'lib/postpolicy/config.rb', line 34 def dbconfig @dbconfig end |
.dbi_params ⇒ Object (readonly)
Returns the value of attribute dbi_params.
34 35 36 |
# File 'lib/postpolicy/config.rb', line 34 def dbi_params @dbi_params end |
Class Method Details
.load(filename) ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/postpolicy/config.rb', line 36 def load( filename ) if filename @dbconfig = YAML.load_file( filename ).stringify_keys!.freeze require "do_#{@dbconfig[:driver]}" @dbi_params = "#{@dbconfig[:driver]}://#{@dbconfig[:user]}:#{@dbconfig[:password]}@#{@dbconfig[:host]}:#{@dbconfig[:port]}/#{@dbconfig[:database]}" end end |