class Convergence::Config
Constants
- ATTRIBUTES
Public Class Methods
load(yaml_path)
click to toggle source
# File lib/convergence/config.rb, line 47 def self.load(yaml_path) setting = YAML.safe_load(ERB.new(File.read(yaml_path)).result, [], [], true) new(setting) end
new(attributes)
click to toggle source
# File lib/convergence/config.rb, line 35 def initialize(attributes) attributes.each do |k, v| next if v.nil? next if !ATTRIBUTES.include?(k.to_sym) && !ATTRIBUTES.include?(k.to_s) instance_variable_set("@#{k}", v) end case adapter when 'mysql', 'mysql2' @mysql = MySQL.new(attributes) end end