portero 0.0.3 → 0.0.4

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.
@@ -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
@@ -1,5 +1,7 @@
1
1
  require 'active_support/core_ext/class/attribute'
2
2
  require 'active_support/core_ext/object/blank'
3
+ require 'active_support/hash_with_indifferent_access'
4
+ require 'active_support/core_ext/hash'
3
5
 
4
6
  module Portero
5
7
  module SearchProvider
@@ -1,3 +1,3 @@
1
1
  module Portero
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: portero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: