Module: Cl::Merge

Included in:
Cl, Cmd, Config, Config::Env, Config::Files, Runner::Default
Defined in:
lib/cl/helper.rb

Constant Summary collapse

MERGE =
->(key, lft, rgt) do
  lft.is_a?(Hash) && rgt.is_a?(Hash) ? lft.merge(rgt, &MERGE) : rgt
end

Instance Method Summary collapse

Instance Method Details

#merge(*objs) ⇒ Object


7
8
9
# File 'lib/cl/helper.rb', line 7

def merge(*objs)
  objs.inject({}) { |lft, rgt| lft.merge(rgt, &MERGE) }
end