How can I append a single value to an array that is stored as an object of the class Citations?
class Citations
attr_accessor :paper,:arr
def dothing()
return paper.to_s.length
end
end
cit = Citations.new
#(1...5).each{ |x| cit.arr << x } # fails
cit.arr = [1,2,3,4] # works if I add the entire array as one unit
puts cit.arr