Module: SettingsManager::Default::ClassMethods

Defined in:
lib/settings-manager/default.rb

Instance Method Summary collapse

Instance Method Details

#default_setting_for(key) ⇒ Object



20
21
22
# File 'lib/settings-manager/default.rb', line 20

def default_setting_for(key)
  default_settings[key.to_s]
end

#default_settingsObject



6
7
8
9
10
11
12
13
14
# File 'lib/settings-manager/default.rb', line 6

def default_settings
  file = @default_settings_config_path

  if file && ::File.exist?(file)
    YAML.load_file(file)[Rails.env] || {}
  else
    {}
  end
end

#default_settings_config(path = nil) ⇒ Object



16
17
18
# File 'lib/settings-manager/default.rb', line 16

def default_settings_config(path = nil)
  @default_settings_config_path = path
end