Module: LHS::Record::Merge
- Extended by:
- ActiveSupport::Concern
- Included in:
- LHS::Record
- Defined in:
- lib/lhs/concerns/record/merge.rb
Instance Method Summary collapse
- #deep_merge(other) ⇒ Object
- #deep_merge!(other) ⇒ Object
- #merge(other) ⇒ Object
- #merge!(other) ⇒ Object
Instance Method Details
#deep_merge(other) ⇒ Object
18 19 20 |
# File 'lib/lhs/concerns/record/merge.rb', line 18 def deep_merge(other) _record.new(_data.to_h.deep_merge(other.to_h)) end |
#deep_merge!(other) ⇒ Object
22 23 24 |
# File 'lib/lhs/concerns/record/merge.rb', line 22 def deep_merge!(other) _data._raw.deep_merge!(other.to_h) end |
#merge(other) ⇒ Object
10 11 12 |
# File 'lib/lhs/concerns/record/merge.rb', line 10 def merge(other) _record.new(_data.to_h.merge(other.to_h)) end |
#merge!(other) ⇒ Object
14 15 16 |
# File 'lib/lhs/concerns/record/merge.rb', line 14 def merge!(other) _data._raw.merge!(other.to_h) end |