Sha256: 41f2e8f691064e26234b2eafe5e1f75c17fac991d83461353c1ffa446e13b39b
Contents?: true
Size: 428 Bytes
Versions: 22
Compression:
Stored size: 428 Bytes
Contents
module Trestle class Options < Hash def self.new(hash={}) self[hash] end def merge(other, &block) dup.merge!(other, &block) end def merge!(other, &block) super(other || {}) do |key, v1, v2| if v1.is_a?(Hash) && v2.is_a?(Hash) v1.merge(v2, &block) elsif v1.is_a?(Array) v1 + Array(v2) else v2 end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems