Sha256: a65cb8f7395dffb9e67b5dbe4a3bd04cefebe182aba9262b218d2dddad8af053

Contents?: true

Size: 529 Bytes

Versions: 148

Compression:

Stored size: 529 Bytes

Contents

module Geokit
  # These defaults are used in Geokit::Mappable.distance_to and in acts_as_mappable
  @@default_units = :miles
  @@default_formula = :sphere

  [:default_units, :default_formula].each do |sym|
    class_eval <<-EOS, __FILE__, __LINE__
      def self.#{sym}
        if defined?(#{sym.to_s.upcase})
          #{sym.to_s.upcase}
        else
          @@#{sym}
        end
      end

      def self.#{sym}=(obj)
        @@#{sym} = obj
      end
    EOS
  end
  Geokit::Geocoders.logger = ActiveRecord::Base.logger
end

Version data entries

148 entries across 148 versions & 11 rubygems

Version Path
albanpeignier-geokit-rails-1.1.0 lib/geokit-rails/defaults.rb
earth-1.0.3 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-1.0.2 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-1.0.1 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-1.0.0 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.12.4 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.12.3 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.12.2 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.12.1 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.12.0 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.20 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.19 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.18 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.17 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.16 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.15 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.14 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.13 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.12 vendor/geokit-rails/lib/geokit-rails/defaults.rb
earth-0.11.11 vendor/geokit-rails/lib/geokit-rails/defaults.rb