End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
CSV::Row#push
row.push(*values) →self
lib/csv/row.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/csv/row.rb, line 331
def push(*args)
args.each { |arg| self << arg }
self # for chaining
end
Appends each of the given values to self as a field; returns self:
Example
source = "Name,Name,Name\nFoo,Bar,Baz\n" table = CSV.parse(source, headers: true) row = table[0] row.push('Bat', 'Bam') row # => #<CSV::Row "Name":"Foo" "Name":"Bar" "Name":"Baz" nil:"Bat" nil:"Bam">