gmaps4rails 0.7.8 → 0.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,11 +32,11 @@ module Gmaps4rails
32
32
  end
33
33
 
34
34
  def Gmaps4rails.title(object)
35
- return "\"description\": \"#{object.gmaps4rails_title}\", " if object.respond_to?("gmaps4rails_title")
35
+ return "\"title\": \"#{object.gmaps4rails_title}\", " if object.respond_to?("gmaps4rails_title")
36
36
  end
37
37
 
38
38
  def Gmaps4rails.sidebar(object)
39
- return "\"description\": \"#{object.gmaps4rails_sidebar}\"," if object.respond_to?("gmaps4rails_sidebar")
39
+ return "\"sidebar\": \"#{object.gmaps4rails_sidebar}\"," if object.respond_to?("gmaps4rails_sidebar")
40
40
  end
41
41
 
42
42
  def Gmaps4rails.picture(object)
@@ -5,6 +5,25 @@ class User < ActiveRecord::Base
5
5
  address
6
6
  end
7
7
 
8
+ def gmaps4rails_infowindow
9
+ "My Beautiful Name: #{name}"
10
+ end
11
+
12
+ def gmaps4rails_marker_picture
13
+ {
14
+ "picture" => "http://www.blankdots.com/img/github-32x32.png",
15
+ "width" => "32",
16
+ "height" => "32"
17
+ }
18
+ end
19
+
20
+ def gmaps4rails_title
21
+ "Sweet Title"
22
+ end
23
+
24
+ def gmaps4rails_sidebar
25
+ "sidebar content"
26
+ end
8
27
  # def gmaps4rails_sidebar
9
28
  # "<b>#{name}</b>"
10
29
  # end
@@ -223,7 +223,7 @@ describe "Acts as gmappable" do
223
223
  "Sweet Title"
224
224
  end
225
225
  end
226
- @user.to_gmaps4rails.should == "[{\"description\": \"Sweet Title\", \"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\"}]"
226
+ @user.to_gmaps4rails.should == "[{\"title\": \"Sweet Title\", \"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\"}]"
227
227
  end
228
228
 
229
229
  it "should take into account the sidebar content provided in the model" do
@@ -233,7 +233,7 @@ describe "Acts as gmappable" do
233
233
  "sidebar content"
234
234
  end
235
235
  end
236
- @user.to_gmaps4rails.should == "[{\"description\": \"sidebar content\",\"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\"}]"
236
+ @user.to_gmaps4rails.should == "[{\"sidebar\": \"sidebar content\",\"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\"}]"
237
237
  end
238
238
 
239
239
  it "should take into account all additional data provided in the model" do
@@ -260,7 +260,7 @@ describe "Acts as gmappable" do
260
260
  "sidebar content"
261
261
  end
262
262
  end
263
- @user.to_gmaps4rails.should == "[{\"description\": \"My Beautiful Picture: \", \"description\": \"Sweet Title\", \"description\": \"sidebar content\",\"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\", \"picture\": \"http://www.blankdots.com/img/github-32x32.png\", \"width\": \"32\", \"height\": \"32\"}]"
263
+ @user.to_gmaps4rails.should == "[{\"description\": \"My Beautiful Picture: \", \"title\": \"Sweet Title\", \"sidebar\": \"sidebar content\",\"longitude\": \"5.9311119\", \"latitude\": \"43.1251606\", \"picture\": \"http://www.blankdots.com/img/github-32x32.png\", \"width\": \"32\", \"height\": \"32\"}]"
264
264
  end
265
265
  end
266
266
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmaps4rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 8
10
- version: 0.7.8
9
+ - 9
10
+ version: 0.7.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Benjamin Roth