diff options
author | Burdette Lamar <[email protected]> | 2020-09-06 19:38:33 -0500 |
---|---|---|
committer | Sutou Kouhei <[email protected]> | 2020-11-24 09:33:55 +0900 |
commit | 207f2acc1355dea1fc1f483e4d8ff3e571a0ad89 () | |
tree | 17afaf00659ba4ba597786280635e26b6f2e50e2 /lib/csv | |
parent | e8954fa13b3d2cf11f425897f9d12397fc4a9ecb (diff) |
[ruby/csv] Enhanced RDoc for CSV::Row (#173)
https://.com/ruby/csv/commit/99956c671d
Notes: Merged: https://.com/ruby/ruby/pull/3804
-rw-r--r-- | lib/csv/row.rb | 54 |
1 files changed, 44 insertions, 10 deletions
@@ -524,10 +524,21 @@ class CSV @row == other end # - # Collapses the row into a simple Hash. Be warned that this discards field - # order and clobbers duplicate fields. # def to_h hash = {} each do |key, _value| @@ -539,20 +550,35 @@ class CSV alias_method :to_ary, :to_a # - # Returns the row as a CSV String. Headers are not used. Equivalent to: - # - # csv_row.fields.to_csv( options ) - # def to_csv(**options) fields.to_csv(**options) end alias_method :to_s, :to_csv # - # Extracts the nested value specified by the sequence of +index+ or +header+ objects by calling dig at each step, - # returning nil if any intermediate step is nil. # def dig(index_or_header, *indexes) value = field(index_or_header) if value.nil? @@ -567,9 +593,17 @@ class CSV end end # - # A summary of fields, by header, in an ASCII compatible String. - # def inspect str = ["#<", self.class.to_s] each do |header, field| |