Module: Geocoder::Model::MongoBase
- Included in:
- MongoMapper, Mongoid
- Defined in:
- lib/geocoder/models/mongo_base.rb
Instance Method Summary collapse
-
#geocoded_by(address_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
-
#reverse_geocoded_by(coordinates_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
Instance Method Details
#geocoded_by(address_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/geocoder/models/mongo_base.rb', line 12 def geocoded_by(address_attr, = {}, &block) geocoder_init( :geocode => true, :user_address => address_attr, :coordinates => [:coordinates] || :coordinates, :geocode_block => block, :units => [:units], :method => [:method], :skip_index => [:skip_index] || false, :lookup => [:lookup], :language => [:language] ) end |
#reverse_geocoded_by(coordinates_attr, options = {}, &block) ⇒ Object
Set attribute names and include the Geocoder module.
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/geocoder/models/mongo_base.rb', line 29 def reverse_geocoded_by(coordinates_attr, = {}, &block) geocoder_init( :reverse_geocode => true, :fetched_address => [:address] || :address, :coordinates => coordinates_attr, :reverse_block => block, :units => [:units], :method => [:method], :skip_index => [:skip_index] || false, :lookup => [:lookup], :language => [:language] ) end |