Methods

AppConfig::Storage::YAML

YAML storage method.

Constants

DEFAULT_PATH

Public Class Methods

new(path = DEFAULT_PATH) click to toggle source

Loads `@data` with the YAML file located at `path`. `@data` will be the Hashish that is accessed with `AppConfig`.

Defaults to `Dir.home/.app_config.yml`

# File lib/app_config/storage/yaml.rb, line 15
def initialize(path = DEFAULT_PATH)
  # Make sure to use the top-level YAML module here.
  @data = Hashish.new(::YAML.load_file(path))
end

Public Instance Methods

[](key) click to toggle source
# File lib/app_config/storage/yaml.rb, line 20
def [](key)
  @data[key]
end
[]=(key, value) click to toggle source
# File lib/app_config/storage/yaml.rb, line 24
def []=(key, value)
  @data[key] = value
end
empty?() click to toggle source
# File lib/app_config/storage/yaml.rb, line 28
def empty?
  @data.empty?
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.