Sha256: 72e04e66e8299a0d8bb28c533017efb6a22129013a04aadf4e5fce6d5f1344a4

Contents?: true

Size: 746 Bytes

Versions: 7

Compression:

Stored size: 746 Bytes

Contents

class Country < ActiveRecord::Base
  set_primary_key :iso_3166_code
  
  falls_back_on :flight_route_inefficiency_factor => 1.10 # for international flights - this is the larger (European) factor from Kettunen et al. (2005) http://www.atmseminar.org/seminarContent/seminar6/papers/p_055_MPM.pdf
  
  data_miner do
    tap "Brighter Planet's sanitized countries list", Earth.taps_server
  end
  
  class << self
    def united_states
      find_by_iso_3166_code('US')
    end
  end
  
  # if we don't have a country-specific flight route inefficiency factor, use the fallback
  def flight_route_inefficiency_factor
    if specific_frif = super
      specific_frif
    else
      Country.fallback.flight_route_inefficiency_factor
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-0.4.6 lib/earth/locality/country.rb
earth-0.4.5 lib/earth/locality/country.rb
earth-0.4.4 lib/earth/locality/country.rb
earth-0.4.3 lib/earth/locality/country.rb
earth-0.4.2 lib/earth/locality/country.rb
earth-0.4.1 lib/earth/locality/country.rb
earth-0.4.0 lib/earth/locality/country.rb