Class: CsvReader::Parser
- Inherits:
-
Object
- Object
- CsvReader::Parser
- Defined in:
- lib/csvreader/base.rb,
lib/csvreader/parser.rb
Constant Summary collapse
- DEFAULT =
use/allow different “backends” e.g. ParserStd, ParserStrict, ParserTab, etc.
parser must support parse method (with and without block) e.g. records = parse( data ) -or- parse( data ) do |record| end
ParserStd.new
- RFC4180 =
ParserStrict.new
- STRICT =
note: make strict its own instance (so you can change config without “breaking” rfc4180)
ParserStrict.new
- EXCEL =
note: make excel its own instance (so you can change configs without “breaking” rfc4180/strict)
ParserStrict.new
- MYSQL =
ParserStrict.new( sep: "\t", quote: false, escape: true, null: "\\N" )
- POSTGRES =
POSTGRESQL = ParserStrict.new( doublequote: false, escape: true, null: "" )
- POSTGRES_TEXT =
POSTGRESQL_TEXT = ParserStrict.new( sep: "\t", quote: false, escape: true, null: "\\N" )
- NUMERIC =
ParserStrict.new( numeric: true, nan: ['#NAN', 'NAN', 'NaN', 'nan' ], null: "" )
- TAB =
ParserTab.new
Class Method Summary collapse
-
.default ⇒ Object
alternative alias for DEFAULT.
-
.excel ⇒ Object
alternative alias for EXCEL.
- .mysql ⇒ Object
- .numeric ⇒ Object
- .postgres ⇒ Object
- .postgres_text ⇒ Object
- .postgresql ⇒ Object
- .postgresql_text ⇒ Object
-
.rfc4180 ⇒ Object
alternative alias for RFC4180.
-
.strict ⇒ Object
alternative alias for STRICT.
- .tab ⇒ Object
Class Method Details
.default ⇒ Object
alternative alias for DEFAULT
64 |
# File 'lib/csvreader/base.rb', line 64 def self.default() DEFAULT; end |
.excel ⇒ Object
alternative alias for EXCEL
67 |
# File 'lib/csvreader/base.rb', line 67 def self.excel() EXCEL; end |
.mysql ⇒ Object
68 |
# File 'lib/csvreader/base.rb', line 68 def self.mysql() MYSQL; end |
.numeric ⇒ Object
73 |
# File 'lib/csvreader/base.rb', line 73 def self.numeric() NUMERIC; end |
.postgres ⇒ Object
70 |
# File 'lib/csvreader/base.rb', line 70 def self.postgres() postgresql; end |
.postgres_text ⇒ Object
72 |
# File 'lib/csvreader/base.rb', line 72 def self.postgres_text() postgresql_text; end |
.postgresql ⇒ Object
69 |
# File 'lib/csvreader/base.rb', line 69 def self.postgresql() POSTGRESQL; end |
.postgresql_text ⇒ Object
71 |
# File 'lib/csvreader/base.rb', line 71 def self.postgresql_text() POSTGRESQL_TEXT; end |
.rfc4180 ⇒ Object
alternative alias for RFC4180
66 |
# File 'lib/csvreader/base.rb', line 66 def self.rfc4180() RFC4180; end |
.strict ⇒ Object
alternative alias for STRICT
65 |
# File 'lib/csvreader/base.rb', line 65 def self.strict() STRICT; end |
.tab ⇒ Object
74 |
# File 'lib/csvreader/base.rb', line 74 def self.tab() TAB; end |