Module: Sequent::Core::Helpers::Mergable

Included in:
BaseCommand
Defined in:
lib/sequent/core/helpers/mergable.rb

Overview

Looks like Copyable but changes this instance

ben = Person.new(name: 'Ben').merge!(name: 'Ben Vonk')

Instance Method Summary collapse

Instance Method Details

#merge!(attrs = {}) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/sequent/core/helpers/mergable.rb', line 11

def merge!(attrs = {})
  warn <<~EOS
    [DEPRECATION] `merge!` is deprecated. Please use `copy` instead. This method will no longer be included in the next version of Sequent. You can still use it but you will have to include the module `Sequent::Core::Helpers::Mergable` yourself.
  EOS
  attrs.each do |name, value|
    send("#{name}=", value)
  end
  self
end