Module: OnTheMap::Addressable

Extended by:
ActiveSupport::Concern
Defined in:
lib/on_the_map/addressable.rb

Instance Method Summary collapse

Instance Method Details

#floor_adr=(adr) ⇒ Object



61
62
63
# File 'lib/on_the_map/addressable.rb', line 61

def floor_adr= adr
  self.address.floor_adr = adr if address
end

#full_addressObject



57
58
59
# File 'lib/on_the_map/addressable.rb', line 57

def full_address
  self.address.full
end

#perform_geocoding?(name) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
48
# File 'lib/on_the_map/addressable.rb', line 45

def perform_geocoding? name
  return unless respond_to? :perform_geocoding
  geocode_field?(name)    
end

#set_address(hash) ⇒ Object



50
51
52
53
54
55
# File 'lib/on_the_map/addressable.rb', line 50

def set_address hash
  adr = Hashie::Mash.new hash
  Address.address_fields.each do |name|
    self.send("#{name}=", adr.send(name)) if adr.send(name)
  end
end