Sha256: dc2ddeb08b0196973379c4cc223e95d814bac337b51948082f127b3b6f31c949
Contents?: true
Size: 597 Bytes
Versions: 10
Compression:
Stored size: 597 Bytes
Contents
require_relative "value_parser" module Eye::Patch class Settings def initialize(filename) @settings = YAML.load(File.open(filename)) end def [](value) parsed[value] end private def parsed @parsed ||= parse(@settings) end def parse(item) case item when Hash item.each_with_object({}) do |(key, val), result| result[key.to_sym] = parse(val) end when Array item.map { |val| parse(val) } when String ValueParser.parse(item) else item end end end end
Version data entries
10 entries across 10 versions & 1 rubygems