You can use Enumerable#partition:
array = [1, 2, 3, 4]
array.partition { |x| x % 2 == 1 }
# => [[1, 3], [2, 4]]
odd, even = array.partition {|x| x % 2 == 1}
odd
# => [1, 3]
even
# => [2, 4]
class One
attr_reader :array
def initialize(array)
@array = array
end
end
class Two < One
attr_reader :array
def initialize
@array = []
end
end
array = [1,2]
a = One.new(array)
b = Two.new
c = Two.new
odd, even = array.partition {|x| x % 2 == 1}
b.array.concat odd
c.array.concat even
b.array
# => [1]
c.array
# => [2]
NOTE: As meagar commented, the problem is not related with inheritance. You don't need to use class here at all.