Class: Address
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Address
- Defined in:
- lib/rails/generators/simple_address_generator/templates/address.rb
Instance Attribute Summary collapse
-
#gmaps ⇒ Object
Returns the value of attribute gmaps.
Instance Method Summary collapse
- #full_address ⇒ Object
- #gmaps4rails_address ⇒ Object
- #gmaps4rails_infowindow ⇒ Object
- #gmaps4rails_marker_picture ⇒ Object
- #gmaps4rails_title ⇒ Object
Instance Attribute Details
#gmaps ⇒ Object
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_address ⇒ Object
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_address ⇒ Object
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_infowindow ⇒ Object
21 22 23 |
# File 'lib/rails/generators/simple_address_generator/templates/address.rb', line 21 def gmaps4rails_infowindow "#{full_address}" end |
#gmaps4rails_marker_picture ⇒ Object
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_title ⇒ Object
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 |