class WrocLove::Airport
Constants
- TimeFormatRule
Attributes
airports[RW]
Public Class Methods
nearest(location, count = 10)
click to toggle source
# File lib/wroc_love/airport.rb, line 16 def nearest(location, count = 10) airports.sort_by{|a| Geocoder::Calculations.distance_between(a.location, location) }.first(count) end
store(*params)
click to toggle source
# File lib/wroc_love/airport.rb, line 12 def store(*params) airports << new(*params).freeze end
Public Instance Methods
description()
click to toggle source
# File lib/wroc_love/airport.rb, line 24 def description "#{code.rjust(5)} #{name.rjust(35)} #{link}" end
link()
click to toggle source
# File lib/wroc_love/airport.rb, line 28 def link "http://www.skyscanner.net/flights/#{code.downcase}/wro/#{WrocLove::Arrival.strftime(TimeFormatRule)}/#{WrocLove::Return.strftime(TimeFormatRule)}" end