Class: GtfsReader::ParserContext

Inherits:
Object
  • Object
show all
Defined in:
lib/gtfs_reader/file_row.rb

Instance Method Summary collapse

Constructor Details

#initialize(column, file_row) ⇒ ParserContext



55
56
57
# File 'lib/gtfs_reader/file_row.rb', line 55

def initialize(column, file_row)
  @column, @file_row = column, file_row
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(column) ⇒ Object



59
60
61
62
63
64
# File 'lib/gtfs_reader/file_row.rb', line 59

def method_missing(column)
  if column == @column
    raise "Parser for '#{column}' cannot refer to itself"
  end
  @file_row[column] or super
end