class Airport::Guru

Public Instance Methods

method_missing(method_id, *args, &block) click to toggle source
Calls superclass method
# File lib/earth/air/airport/data_miner.rb, line 5
def method_missing(method_id, *args, &block)
  if method_id.to_s =~ /\A(id|iata)_is_([a-z]{3}|\d{1,4})\?$/
    regexp = Regexp.new($2, Regexp::IGNORECASE)
    if $1 == "iata"
      args.first['iata_code'] =~ regexp # row['iata_code'] =~ /meh/i
    else
      args.first[$1] =~ regexp # row['id'] =~ /1234/i
    end
  else
    super
  end
end