Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit dbd860c

Browse files
BurdetteLamarkou
andauthored
Adding call-seq to methods RDoc (#155)
* Adding call-seq to methods RDoc Co-authored-by: Sutou Kouhei <[email protected]>
1 parent 72d8a25 commit dbd860c

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

lib/csv.rb

+51
Original file line numberDiff line numberDiff line change
@@ -1673,41 +1673,59 @@ def initialize(data,
16731673
writer if @writer_options[:write_headers]
16741674
end
16751675

1676+
# :call-seq:
1677+
# csv.col_sep -> string
1678+
#
16761679
# Returns the encoded column separator; used for parsing and writing;
16771680
# see {Option +col_sep+}[#class-CSV-label-Option+col_sep]:
16781681
# CSV.new('').col_sep # => ","
16791682
def col_sep
16801683
parser.column_separator
16811684
end
16821685

1686+
# :call-seq:
1687+
# csv.row_sep -> string
1688+
#
16831689
# Returns the encoded row separator; used for parsing and writing;
16841690
# see {Option +row_sep+}[#class-CSV-label-Option+row_sep]:
16851691
# CSV.new('').row_sep # => "\n"
16861692
def row_sep
16871693
parser.row_separator
16881694
end
16891695

1696+
# :call-seq:
1697+
# csv.quote_char -> character
1698+
#
16901699
# Returns the encoded quote character; used for parsing and writing;
16911700
# see {Option +quote_char+}[#class-CSV-label-Option+quote_char]:
16921701
# CSV.new('').quote_char # => "\""
16931702
def quote_char
16941703
parser.quote_character
16951704
end
16961705

1706+
# :call-seq:
1707+
# csv.field_size_limit -> integer or nil
1708+
#
16971709
# Returns the limit for field size; used for parsing;
16981710
# see {Option +field_size_limit+}[#class-CSV-label-Option+field_size_limit]:
16991711
# CSV.new('').field_size_limit # => nil
17001712
def field_size_limit
17011713
parser.field_size_limit
17021714
end
17031715

1716+
# :call-seq:
1717+
# csv.skip_lines -> regexp or nil
1718+
#
17041719
# Returns the \Regexp used to identify comment lines; used for parsing;
17051720
# see {Option +skip_lines+}[#class-CSV-label-Option+skip_lines]:
17061721
# CSV.new('').skip_lines # => nil
17071722
def skip_lines
17081723
parser.skip_lines
17091724
end
17101725

1726+
# :call-seq:
1727+
# csv.converters -> array
1728+
#
17111729
# Returns an \Array containing field converters; used for parsing;
17121730
# see {Option +converters+}[#class-CSV-label-Option+converters]:
17131731
# CSV.new('').converters # => []
@@ -1718,6 +1736,9 @@ def converters
17181736
end
17191737
end
17201738

1739+
# :call-seq:
1740+
# csv.unconverted_fields? -> object
1741+
#
17211742
# Returns the value that determines whether unconverted fields are to be
17221743
# available; used for parsing;
17231744
# see {Option +unconverted_fields+}[#class-CSV-label-Option+unconverted_fields]:
@@ -1726,6 +1747,9 @@ def unconverted_fields?
17261747
parser.unconverted_fields?
17271748
end
17281749

1750+
# :call-seq:
1751+
# csv.headers -> object
1752+
#
17291753
# Returns the value that determines whether headers are used; used for parsing;
17301754
# see {Option +headers+}[#class-CSV-label-Option+headers]:
17311755
# CSV.new('').headers # => nil
@@ -1741,20 +1765,29 @@ def headers
17411765
end
17421766
end
17431767

1768+
# :call-seq:
1769+
# csv.return_headers? -> true or false
1770+
#
17441771
# Returns the value that determines whether headers are to be returned; used for parsing;
17451772
# see {Option +return_headers+}[#class-CSV-label-Option+return_headers]:
17461773
# CSV.new('').return_headers? # => false
17471774
def return_headers?
17481775
parser.return_headers?
17491776
end
17501777

1778+
# :call-seq:
1779+
# csv.write_headers? -> true or false
1780+
#
17511781
# Returns the value that determines whether headers are to be written; used for generating;
17521782
# see {Option +write_headers+}[#class-CSV-label-Option+write_headers]:
17531783
# CSV.new('').write_headers? # => nil
17541784
def write_headers?
17551785
@writer_options[:write_headers]
17561786
end
17571787

1788+
# :call-seq:
1789+
# csv.header_converters -> array
1790+
#
17581791
# Returns an \Array containing header converters; used for parsing;
17591792
# see {Option +header_converters+}[#class-CSV-label-Option+header_converters]:
17601793
# CSV.new('').header_converters # => []
@@ -1765,13 +1798,19 @@ def header_converters
17651798
end
17661799
end
17671800

1801+
# :call-seq:
1802+
# csv.skip_blanks? -> true or false
1803+
#
17681804
# Returns the value that determines whether blank lines are to be ignored; used for parsing;
17691805
# see {Option +skip_blanks+}[#class-CSV-label-Option+skip_blanks]:
17701806
# CSV.new('').skip_blanks? # => false
17711807
def skip_blanks?
17721808
parser.skip_blanks?
17731809
end
17741810

1811+
# :call-seq:
1812+
# csv.force_quotes? -> true or false
1813+
#
17751814
# Returns the value that determines whether all output fields are to be quoted;
17761815
# used for generating;
17771816
# see {Option +force_quotes+}[#class-CSV-label-Option+force_quotes]:
@@ -1780,18 +1819,27 @@ def force_quotes?
17801819
@writer_options[:force_quotes]
17811820
end
17821821

1822+
# :call-seq:
1823+
# csv.liberal_parsing? -> true or false
1824+
#
17831825
# Returns the value that determines whether illegal input is to be handled; used for parsing;
17841826
# see {Option +liberal_parsing+}[#class-CSV-label-Option+liberal_parsing]:
17851827
# CSV.new('').liberal_parsing? # => false
17861828
def liberal_parsing?
17871829
parser.liberal_parsing?
17881830
end
17891831

1832+
# :call-seq:
1833+
# csv.encoding -> endcoding
1834+
#
17901835
# Returns the encoding used for parsing and generating;
17911836
# see {CSV and Character Encodings (M17n or Multilingualization)}[#class-CSV-label-CSV+and+Character+Encodings+-28M17n+or+Multilingualization-29]:
17921837
# CSV.new('').encoding # => #<Encoding:UTF-8>
17931838
attr_reader :encoding
17941839

1840+
# :call-seq:
1841+
# csv.line_no -> integer
1842+
#
17951843
# Returns the count of the rows parsed or generated.
17961844
#
17971845
# Parsing:
@@ -1826,6 +1874,9 @@ def lineno
18261874
end
18271875
end
18281876

1877+
# :call-seq:
1878+
# csv.line -> array
1879+
#
18291880
# Returns the line most recently read:
18301881
# string = "foo,0\nbar,1\nbaz,2\n"
18311882
# path = 't.csv'

0 commit comments

Comments
 (0)