Module: Cl::Merge

Included in:
Cl, Cmd, Cmd::Dsl, 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


9
10
11
# File 'lib/cl/helper.rb', line 9

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