Class: SportDb::CsvGoalParser
- Inherits:
-
Object
- Object
- SportDb::CsvGoalParser
- Defined in:
- lib/sportdb/quick/csv/goal_parser_csv.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(txt) ⇒ CsvGoalParser
constructor
A new instance of CsvGoalParser.
- #parse ⇒ Object
Constructor Details
#initialize(txt) ⇒ CsvGoalParser
Returns a new instance of CsvGoalParser.
16 17 18 |
# File 'lib/sportdb/quick/csv/goal_parser_csv.rb', line 16 def initialize( txt ) @txt = txt end |
Class Method Details
.parse(txt) ⇒ Object
11 12 13 |
# File 'lib/sportdb/quick/csv/goal_parser_csv.rb', line 11 def self.parse( txt ) new( txt ).parse end |
.read(path) ⇒ Object
6 7 8 9 |
# File 'lib/sportdb/quick/csv/goal_parser_csv.rb', line 6 def self.read( path ) txt = File.open( path, 'r:utf-8' ) {|f| f.read } ## note: make sure to use (assume) utf-8 parse( txt ) end |