Sha256: 1f029d1263008566009466df2844c659918aa7a629b0d77c4a3f29c99b683d15
Contents?: true
Size: 588 Bytes
Versions: 15
Compression:
Stored size: 588 Bytes
Contents
require 'hashie/mash' module Chamber module Environmentable def with_environment(settings, parent_keys, hash_block, value_block) environment_hash = Hashie::Mash.new settings.each_pair do |key, value| environment_keys = parent_keys.dup.push(key) if value.respond_to? :each_pair environment_hash.merge!(hash_block.call(key, value, environment_keys)) else environment_key = environment_keys.join('_').upcase environment_hash.merge!(value_block.call(key, value, environment_key)) end end environment_hash end end end
Version data entries
15 entries across 15 versions & 1 rubygems