Module: Polyfill::V2_4::String::Instance::Concat::Method

Defined in:
lib/polyfill/v2_4/string/instance/concat.rb

Instance Method Summary collapse

Instance Method Details

#concat(*others) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/polyfill/v2_4/string/instance/concat.rb', line 7

def concat(*others)
  return super if others.length == 1

  acc = '' << self
  others.each do |other|
    acc << other
  end

  replace(acc)
end