Module: File::CSV
- Defined in:
- lib/ruuuby/class/io/file.rb
Overview
Class Method Summary collapse
- .read(path, row_sep = $/, encoding = 'US_ASCII') ⇒ Array
- .read!(path, row_sep = $/, encoding = 'US_ASCII') ⇒ Array
Class Method Details
.read(path, row_sep = $/, encoding = 'US_ASCII') ⇒ Array
124 125 126 127 |
# File 'lib/ruuuby/class/io/file.rb', line 124 def self.read(path, row_sep=$/, encoding='US_ASCII') πstrsβ([path, encoding, row_sep]) ::CSV.read(path, {skip_blanks: true, headers: true, col_sep: ',', row_sep: row_sep, encoding: encoding}) end |
.read!(path, row_sep = $/, encoding = 'US_ASCII') ⇒ Array
136 137 138 139 140 141 142 143 |
# File 'lib/ruuuby/class/io/file.rb', line 136 def self.read!(path, row_sep=$/, encoding='US_ASCII') πstrsβ([path, encoding, row_sep]) if ::File.β?(path, true) ::CSV.read(path, {skip_blanks: true, headers: true, col_sep: ',', row_sep: row_sep, encoding: encoding}) else π ::ArgumentError.new("| c{File::CSV}-> m{read!} received arg(path) w/ val{#{path}} which is not a valid file reference |") end end |