Class: Conan::SmartHashMerge
- Inherits:
-
Object
- Object
- Conan::SmartHashMerge
- Defined in:
- lib/conan/smart_hash_merge.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(lhash, rhash) ⇒ SmartHashMerge
constructor
A new instance of SmartHashMerge.
- #merge ⇒ Object
Constructor Details
#initialize(lhash, rhash) ⇒ SmartHashMerge
Returns a new instance of SmartHashMerge.
7 8 9 |
# File 'lib/conan/smart_hash_merge.rb', line 7 def initialize(lhash, rhash) @lhash, @rhash = lhash, rhash end |
Class Method Details
.merge(lhash, rhash) ⇒ Object
3 4 5 |
# File 'lib/conan/smart_hash_merge.rb', line 3 def self.merge(lhash, rhash) new(lhash, rhash).merge end |
Instance Method Details
#merge ⇒ Object
11 12 13 14 |
# File 'lib/conan/smart_hash_merge.rb', line 11 def merge lhash = @lhash.dup deep_merge(lhash, @rhash) end |