Class: Address

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/rails/generators/simple_address_generator/templates/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#gmapsObject

Returns the value of attribute gmaps.



3
4
5
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 3

def gmaps
  @gmaps
end

Instance Method Details

#full_addressObject



12
13
14
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 12

def full_address
  [self.address_line_1, self.address_line_2, self.city, self.state, self.country, self.postal_code].compact.join(", ")
end

#gmaps4rails_addressObject



16
17
18
19
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 16

def gmaps4rails_address
#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki
    full_address
end

#gmaps4rails_infowindowObject



21
22
23
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 21

def gmaps4rails_infowindow
    "#{full_address}"
end

#gmaps4rails_marker_pictureObject



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 30

def gmaps4rails_marker_picture
  {
   "picture" => "/assets/icon-1.png",
   "width" => 30,
   "height" => 30,
   "marker_anchor" => [ 5, 10],
   "shadow_width" => "110",
   "shadow_height" => "110",
   "shadow_anchor" => [5, 10]
  }
end

#gmaps4rails_titleObject



25
26
27
28
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 25

def gmaps4rails_title
    # add here whatever text you desire
    "Testing"
end