timrogers / airports

Access data on airports from around the world using Ruby
MIT License
32 stars 20 forks source link

find_by_iata_code does not work with Ruby 3.0.0 #59

Closed kleinjm closed 3 years ago

kleinjm commented 3 years ago

Calling Airports.find_by_iata_code("LHR") produces

ArgumentError: wrong number of arguments (given 1, expected 0; required keywords: name, city, country, iata, icao, latitude, longitude, altitude, timezone, dst, tz_name)

The fix (I've confirmed) is to splat the hash here https://github.com/timrogers/airports/blob/v1.6.1/lib/airports.rb#L44 Ie. Airport.new(**transformed_hash)