Class: Gmaps4rails::MarkersBuilder::MarkerBuilder
- Inherits:
-
Object
- Object
- Gmaps4rails::MarkersBuilder::MarkerBuilder
- Defined in:
- lib/gmaps4rails/markers_builder.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #call(&block) ⇒ Object
- #infowindow(string) ⇒ Object
-
#initialize(object) ⇒ MarkerBuilder
constructor
A new instance of MarkerBuilder.
- #json(hash) ⇒ Object
- #lat(float) ⇒ Object
- #lng(float) ⇒ Object
- #picture(hash) ⇒ Object
- #shadow(hash) ⇒ Object
- #title(string) ⇒ Object
Constructor Details
#initialize(object) ⇒ MarkerBuilder
Returns a new instance of MarkerBuilder.
39 40 41 42 |
# File 'lib/gmaps4rails/markers_builder.rb', line 39 def initialize(object) @object = object @hash = {} end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
38 39 40 |
# File 'lib/gmaps4rails/markers_builder.rb', line 38 def hash @hash end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
38 39 40 |
# File 'lib/gmaps4rails/markers_builder.rb', line 38 def object @object end |
Instance Method Details
#call(&block) ⇒ Object
44 45 46 47 |
# File 'lib/gmaps4rails/markers_builder.rb', line 44 def call(&block) block.call(object, self) hash end |
#infowindow(string) ⇒ Object
57 58 59 |
# File 'lib/gmaps4rails/markers_builder.rb', line 57 def infowindow(string) @hash[:infowindow] = string end |
#json(hash) ⇒ Object
65 66 67 |
# File 'lib/gmaps4rails/markers_builder.rb', line 65 def json(hash) @hash.merge! hash end |
#lat(float) ⇒ Object
49 50 51 |
# File 'lib/gmaps4rails/markers_builder.rb', line 49 def lat(float) @hash[:lat] = float end |
#lng(float) ⇒ Object
53 54 55 |
# File 'lib/gmaps4rails/markers_builder.rb', line 53 def lng(float) @hash[:lng] = float end |
#picture(hash) ⇒ Object
69 70 71 |
# File 'lib/gmaps4rails/markers_builder.rb', line 69 def picture(hash) @hash[:picture] = hash end |
#shadow(hash) ⇒ Object
73 74 75 |
# File 'lib/gmaps4rails/markers_builder.rb', line 73 def shadow(hash) @hash[:shadow] = hash end |
#title(string) ⇒ Object
61 62 63 |
# File 'lib/gmaps4rails/markers_builder.rb', line 61 def title(string) @hash[:marker_title] = string end |