city_grid 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/city_grid.gemspec CHANGED
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_runtime_dependency 'curb'
19
19
  gem.add_runtime_dependency 'json'
20
+ gem.add_runtime_dependency 'hashie'
20
21
  gem.add_development_dependency 'pry'
21
22
  end
data/lib/city_grid/api.rb CHANGED
@@ -8,7 +8,7 @@ module CityGrid
8
8
  end
9
9
 
10
10
  def results
11
- request.parsed_response
11
+ Result.new(request.parsed_response)
12
12
  end
13
13
 
14
14
  def request
@@ -0,0 +1,7 @@
1
+ module CityGrid
2
+ class Detail < Api
3
+ def uri
4
+ '/places/v2/detail'
5
+ end
6
+ end
7
+ end
@@ -13,6 +13,10 @@ module CityGrid
13
13
  end
14
14
 
15
15
  private
16
+ def request_class
17
+ request_opts[:request_class] || Curl
18
+ end
19
+
16
20
  def default_opts
17
21
  {
18
22
  format: 'json',
@@ -25,7 +29,7 @@ module CityGrid
25
29
  end
26
30
 
27
31
  def make_request
28
- Curl.get(@uri, @request_opts)
32
+ request_class.get(@uri, @request_opts)
29
33
  end
30
34
  end
31
35
  end
@@ -0,0 +1,4 @@
1
+ module CityGrid
2
+ class Result < Hashie::Mash
3
+ end
4
+ end
@@ -1,3 +1,3 @@
1
1
  module CityGrid
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/lib/city_grid.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'hashie'
1
2
  require 'city_grid/version'
2
3
  require 'city_grid/config'
3
4
  require 'city_grid/request'
@@ -5,6 +6,8 @@ require 'city_grid/api'
5
6
  require 'city_grid/reviews'
6
7
  require 'city_grid/places'
7
8
  require 'city_grid/offers'
9
+ require 'city_grid/detail'
10
+ require 'city_grid/result'
8
11
 
9
12
  module CityGrid
10
13
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: city_grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-17 00:00:00.000000000 Z
12
+ date: 2012-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: curb
16
- requirement: &16356840 !ruby/object:Gem::Requirement
16
+ requirement: &6945960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *16356840
24
+ version_requirements: *6945960
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &16356340 !ruby/object:Gem::Requirement
27
+ requirement: &6945180 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,21 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *16356340
35
+ version_requirements: *6945180
36
+ - !ruby/object:Gem::Dependency
37
+ name: hashie
38
+ requirement: &6961320 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: *6961320
36
47
  - !ruby/object:Gem::Dependency
37
48
  name: pry
38
- requirement: &16355880 !ruby/object:Gem::Requirement
49
+ requirement: &6960740 !ruby/object:Gem::Requirement
39
50
  none: false
40
51
  requirements:
41
52
  - - ! '>='
@@ -43,7 +54,7 @@ dependencies:
43
54
  version: '0'
44
55
  type: :development
45
56
  prerelease: false
46
- version_requirements: *16355880
57
+ version_requirements: *6960740
47
58
  description: Ruby wrapper for CityGrid API
48
59
  email:
49
60
  - nicholas.fine@gmail.com
@@ -60,9 +71,11 @@ files:
60
71
  - lib/city_grid.rb
61
72
  - lib/city_grid/api.rb
62
73
  - lib/city_grid/config.rb
74
+ - lib/city_grid/detail.rb
63
75
  - lib/city_grid/offers.rb
64
76
  - lib/city_grid/places.rb
65
77
  - lib/city_grid/request.rb
78
+ - lib/city_grid/result.rb
66
79
  - lib/city_grid/reviews.rb
67
80
  - lib/city_grid/version.rb
68
81
  homepage: ''