lib/vatsim_online/callsign_parser.rb
def stations
      stations = []
      CSV.foreach(LOCAL_DATA, :col_sep =>':') do |row|
        callsign, origin, destination, client = row[0].to_s, row[11].to_s, row[13].to_s, row[3].to_s
        for cs in @callsign
          stations << row if callsign[0...cs.length] == cs # && client == "ATC") unless @role == "pilot"
          # stations << row if (origin[0...icao.length] == icao || destination[0...icao.length] == icao) unless @role == "atc"
        end
      end
      stations
    end
def stations
      stations = []
      CSV.foreach(LOCAL_DATA, :col_sep =>':') do |row|
        callsign, origin, destination, client = row[0].to_s, row[11].to_s, row[13].to_s, row[3].to_s
        for cs in @callsign
          stations << row if callsign[0...cs.length] == cs # && client == "ATC") unless @role == "pilot"
          # stations << row if (origin[0...icao.length] == icao || destination[0...icao.length] == icao) unless @role == "atc"
        end
      end
      stations
    end
def determine_role(args)
   args[:atc] == false ? role = "pilot" : role = "all"
   args[:pilots] == false ? role = "atc" : role = role
   role = "all" if args[:pilots] == false && args[:atc] == false
   role
 end