Class: Gmaps4rails::MarkersBuilder::MarkerBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/gmaps4rails/markers_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#hashObject (readonly)

Returns the value of attribute hash.



38
39
40
# File 'lib/gmaps4rails/markers_builder.rb', line 38

def hash
  @hash
end

#objectObject (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