Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
CSV::Row#deconstruct_keys
row.deconstruct_keys(keys) → hash
lib/csv/row.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/lib/csv/row.rb, line 667
def deconstruct_keys(keys)
if keys.nil?
to_h
else
keys.to_h { |key| [key, self[key]] }
end
end
Returns the new Hash suitable for pattern matching containing only the keys specified as an argument.