Sha256: d2840bdc3d2d31a63a7e3eeab694a9c975dea90414407a8963d8343cbf991134
Contents?: true
Size: 518 Bytes
Versions: 5
Compression:
Stored size: 518 Bytes
Contents
module AppManifest # A simple model-like wrapper around a manifest hash. class Manifest def self.from_json(string) hash = MultiJson.load(string) self.new(hash) end def initialize(hash) @manifest = AppManifest.canonicalize(hash) end def environment(name) env_manifest = manifest.fetch(:environments, {}).fetch(name, {}) self.class.new(manifest.merge(env_manifest)) end def to_hash manifest end private attr_reader :manifest end end
Version data entries
5 entries across 5 versions & 1 rubygems