portero 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,7 @@ module Portero
|
|
36
36
|
venue.country = found_venue["location"]["country"]
|
37
37
|
venue.category = found_venue["categories"].first["name"] if found_venue["categories"].first
|
38
38
|
venue.icon = found_venue["categories"].first["icon"]["prefix"] + "64" + found_venue["categories"].first["icon"]["suffix"] if found_venue["categories"].first
|
39
|
-
venue.extra = {categories: found_venue["categories"], url: found_venue["url"]}
|
39
|
+
venue.extra = HashWithIndifferentAccess.new({categories: found_venue["categories"], url: found_venue["url"]})
|
40
40
|
|
41
41
|
results << venue
|
42
42
|
end
|
@@ -36,7 +36,7 @@ module Portero
|
|
36
36
|
venue.country = ""
|
37
37
|
venue.category = found_venue["types"].first
|
38
38
|
venue.icon = found_venue["icon"]
|
39
|
-
venue.extra = {types: found_venue["types"]}
|
39
|
+
venue.extra = HashWithIndifferentAccess.new({types: found_venue["types"]})
|
40
40
|
|
41
41
|
results << venue
|
42
42
|
end
|
data/lib/portero/version.rb
CHANGED
@@ -75,10 +75,14 @@ describe Portero::SearchProvider::Foursquare do
|
|
75
75
|
@results.first.category.should == "Bar"
|
76
76
|
end
|
77
77
|
|
78
|
-
|
79
78
|
it 'should have an icon' do
|
80
79
|
@results.first.icon.should == "https://foursquare.com/img/categories_v2/nightlife/bar_64.png"
|
81
80
|
end
|
81
|
+
|
82
|
+
it 'should have extra data that should be accessible via string or symbol keys' do
|
83
|
+
@results.first.extra["categories"].first["icon"]["prefix"] == "https://foursquare.com/img/categories_v2/nightlife/bar_"
|
84
|
+
@results.first.extra[:categories].first[:icon][:suffix] == ".png"
|
85
|
+
end
|
82
86
|
end
|
83
87
|
end
|
84
88
|
end
|