Module: Useful::RubyExtensions::Array::ClassMethods
- Defined in:
- lib/useful/ruby_extensions/array.rb,
lib/useful/ruby_extensions/array.rb
Instance Method Summary collapse
-
#merge(a1, a2) ⇒ Object
adds the contents of a2 to a1, removing duplicates.
Instance Method Details
#merge(a1, a2) ⇒ Object
adds the contents of a2 to a1, removing duplicates
14 15 16 17 |
# File 'lib/useful/ruby_extensions/array.rb', line 14 def merge(a1,a2) a2.each{|item| a1 << item unless a1.include?(item)} a1 end |