Sha256: e884bbc5f55390468695801635642db547ba9e256100f93abb3d3a1909648a8d
Contents?: true
Size: 667 Bytes
Versions: 3
Compression:
Stored size: 667 Bytes
Contents
# encoding: utf-8 module Nanoc class ConfigView # @api private NONE = Object.new # @api private def initialize(config) @config = config end # @api private def unwrap @config end # @see Hash#fetch def fetch(key, fallback=NONE, &block) @config.fetch(key) do if !fallback.equal?(NONE) fallback elsif block_given? yield(key) else raise KeyError, "key not found: #{key.inspect}" end end end # @see Hash#key? def key?(key) @config.key?(key) end # @see Hash#[] def [](key) @config[key] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nanoc-4.0.0b2 | lib/nanoc/base/views/config.rb |
nanoc-4.0.0b1 | lib/nanoc/base/views/config.rb |
nanoc-4.0.0a2 | lib/nanoc/base/views/config.rb |