Module: DbVcs::ConfigAttributes

Included in:
Adapters::Mongo::Config, Adapters::Mysql::Config, Adapters::Postgres::Config, Config
Defined in:
lib/db_vcs/config_attributes.rb

Instance Method Summary collapse

Instance Method Details

#assign_attributes(hash) ⇒ void

This method returns an undefined value.

Assigns config attributes from hash.

Parameters:

  • hash (Hash)

    Example:

    {
      environments: ["development"],
      pg_config: {
        port: 5433
      }
    }
    


15
16
17
18
19
20
21
# File 'lib/db_vcs/config_attributes.rb', line 15

def assign_attributes(hash)
  hash.each do |k, v|
    if public_methods(false).include?(:"#{k}=")
      public_send(:"#{k}=", v)
    end
  end
end