Skip to main content
edited tags
Link
Michael Kohl
  • 66.9k
  • 14
  • 143
  • 161
minor edits for grammar and formatting
Source Link
mikej
  • 66.6k
  • 18
  • 156
  • 131

I have a few arrays of Ruby objects of class UserInfo:

class UserInfo attr_accessor :name, :title, :age end:

class UserInfo  
    attr_accessor :name, :title, :age
end

How can I merge these arrays into one array? A user is identified by it'sits name, so I want no duplicate names. If name, title, age, etc. are equal I'd like to have 1 entry in the new array. If names are the same, but any of the other details differ I probably want those 2 users in a different array to manually fix the errors.

Thanks in advance

I have a few arrays of Ruby objects of class UserInfo:

class UserInfo attr_accessor :name, :title, :age end

How can I merge these arrays into one array? A user is identified by it's name, so I want no duplicate names. If name, title, age, etc. are equal I'd like to have 1 entry in the new array. If names are the same, but any of the other details differ I probably want those 2 users in a different array to manually fix the errors.

Thanks in advance

I have a few arrays of Ruby objects of class UserInfo:

class UserInfo  
    attr_accessor :name, :title, :age
end

How can I merge these arrays into one array? A user is identified by its name, so I want no duplicate names. If name, title, age, etc. are equal I'd like to have 1 entry in the new array. If names are the same, but any of the other details differ I probably want those 2 users in a different array to manually fix the errors.

Thanks in advance

Source Link

Merge Ruby arrays

I have a few arrays of Ruby objects of class UserInfo:

class UserInfo attr_accessor :name, :title, :age end

How can I merge these arrays into one array? A user is identified by it's name, so I want no duplicate names. If name, title, age, etc. are equal I'd like to have 1 entry in the new array. If names are the same, but any of the other details differ I probably want those 2 users in a different array to manually fix the errors.

Thanks in advance