Class: GtfsReader::ParserContext
- Inherits:
-
Object
- Object
- GtfsReader::ParserContext
- Defined in:
- lib/gtfs_reader/file_row.rb
Instance Method Summary collapse
-
#initialize(column, file_row) ⇒ ParserContext
constructor
A new instance of ParserContext.
- #method_missing(column) ⇒ Object
- #respond_to_missing?(_name, _include_private = false) ⇒ Boolean
Constructor Details
#initialize(column, file_row) ⇒ ParserContext
Returns a new instance of ParserContext.
59 60 61 62 |
# File 'lib/gtfs_reader/file_row.rb', line 59 def initialize(column, file_row) @column = column @file_row = file_row end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(column) ⇒ Object
64 65 66 67 68 |
# File 'lib/gtfs_reader/file_row.rb', line 64 def method_missing(column) raise "Parser for '#{column}' cannot refer to itself" if column == @column @file_row.col?(column) ? @file_row[column] : super end |
Instance Method Details
#respond_to_missing?(_name, _include_private = false) ⇒ Boolean
70 71 72 |
# File 'lib/gtfs_reader/file_row.rb', line 70 def respond_to_missing?(_name, _include_private = false) true end |