Module: Geokit::Geocoders
- Defined in:
- lib/geokit/geocoders.rb,
lib/geokit/geocoders_v3.rb,
lib/geokit/geocoder_google.rb,
lib/geokit/geocoder_google_v3.rb
Defined Under Namespace
Classes: Geocoder, GoogleGeocoder
Constant Summary collapse
- @@request_timeout =
nil
- @@google =
'REPLACE_WITH_YOUR_GOOGLE_KEY'
- @@logger =
Logger.new(STDOUT)
- @@domain =
nil
Class Method Summary collapse
Class Method Details
.__define_accessors ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/geokit/geocoders.rb', line 28 def self.__define_accessors class_variables.each do |v| sym = v.to_s.delete("@").to_sym unless self.respond_to? sym module_eval <<-EOS, __FILE__, __LINE__ def self.#{sym} value = if defined?(#{sym.to_s.upcase}) #{sym.to_s.upcase} else @@#{sym} end if value.is_a?(Hash) value = (self.domain.nil? ? nil : value[self.domain]) || value.values.first end value end def self.#{sym}=(obj) @@#{sym} = obj end EOS end end end |