mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix keyword argument separation issues in lib
Mostly requires adding ** in either calls or method definitions.
This commit is contained in:
parent
3f67fcd3d5
commit
d08e1004e0
Notes:
git
2019-08-31 04:40:18 +09:00
13 changed files with 38 additions and 38 deletions
|
|
@ -4,6 +4,6 @@ class Array # :nodoc:
|
|||
# ["CSV", "data"].to_csv
|
||||
# #=> "CSV,data\n"
|
||||
def to_csv(**options)
|
||||
CSV.generate_line(self, options)
|
||||
CSV.generate_line(self, **options)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ class String # :nodoc:
|
|||
# "CSV,data".parse_csv
|
||||
# #=> ["CSV", "data"]
|
||||
def parse_csv(**options)
|
||||
CSV.parse_line(self, options)
|
||||
CSV.parse_line(self, **options)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ class CSV
|
|||
# csv_row.fields.to_csv( options )
|
||||
#
|
||||
def to_csv(**options)
|
||||
fields.to_csv(options)
|
||||
fields.to_csv(**options)
|
||||
end
|
||||
alias_method :to_s, :to_csv
|
||||
|
||||
|
|
|
|||
|
|
@ -367,9 +367,9 @@ class CSV
|
|||
# pass <tt>:write_headers => false</tt>.
|
||||
#
|
||||
def to_csv(write_headers: true, **options)
|
||||
array = write_headers ? [headers.to_csv(options)] : []
|
||||
array = write_headers ? [headers.to_csv(**options)] : []
|
||||
@table.each do |row|
|
||||
array.push(row.fields.to_csv(options)) unless row.header_row?
|
||||
array.push(row.fields.to_csv(**options)) unless row.header_row?
|
||||
end
|
||||
|
||||
array.join("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue