city_grid 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/lib/city_grid/api.rb +22 -0
- data/lib/city_grid/offers.rb +11 -0
- data/lib/city_grid/places.rb +11 -0
- data/lib/city_grid/reviews.rb +1 -16
- data/lib/city_grid/version.rb +1 -1
- data/lib/city_grid.rb +3 -0
- metadata +10 -7
data/.gitignore
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module CityGrid
|
2
|
+
class Api
|
3
|
+
|
4
|
+
attr_reader :request_opts
|
5
|
+
|
6
|
+
def initialize request_opts={}
|
7
|
+
@request_opts = request_opts
|
8
|
+
end
|
9
|
+
|
10
|
+
def results
|
11
|
+
request.parsed_response
|
12
|
+
end
|
13
|
+
|
14
|
+
def request
|
15
|
+
@request ||= Request.new(uri, request_opts)
|
16
|
+
end
|
17
|
+
|
18
|
+
def uri
|
19
|
+
raise "must be called from a subclass of Api"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/city_grid/reviews.rb
CHANGED
@@ -1,20 +1,5 @@
|
|
1
1
|
module CityGrid
|
2
|
-
class Reviews
|
3
|
-
|
4
|
-
attr_reader :request_opts
|
5
|
-
|
6
|
-
def initialize request_opts={}
|
7
|
-
@request_opts = request_opts
|
8
|
-
end
|
9
|
-
|
10
|
-
def results
|
11
|
-
request.parsed_response
|
12
|
-
end
|
13
|
-
|
14
|
-
def request
|
15
|
-
@request ||= Request.new(uri, request_opts)
|
16
|
-
end
|
17
|
-
|
2
|
+
class Reviews < Api
|
18
3
|
def uri
|
19
4
|
if request_opts.has_key?(:lat) && request_opts.has_key?(:lon)
|
20
5
|
'/reviews/v2/search/latlon'
|
data/lib/city_grid/version.rb
CHANGED
data/lib/city_grid.rb
CHANGED
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.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-09-17 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: curb
|
16
|
-
requirement: &
|
16
|
+
requirement: &16356840 !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: *
|
24
|
+
version_requirements: *16356840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: json
|
27
|
-
requirement: &
|
27
|
+
requirement: &16356340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *16356340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: pry
|
38
|
-
requirement: &
|
38
|
+
requirement: &16355880 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *16355880
|
47
47
|
description: Ruby wrapper for CityGrid API
|
48
48
|
email:
|
49
49
|
- nicholas.fine@gmail.com
|
@@ -58,7 +58,10 @@ files:
|
|
58
58
|
- Rakefile
|
59
59
|
- city_grid.gemspec
|
60
60
|
- lib/city_grid.rb
|
61
|
+
- lib/city_grid/api.rb
|
61
62
|
- lib/city_grid/config.rb
|
63
|
+
- lib/city_grid/offers.rb
|
64
|
+
- lib/city_grid/places.rb
|
62
65
|
- lib/city_grid/request.rb
|
63
66
|
- lib/city_grid/reviews.rb
|
64
67
|
- lib/city_grid/version.rb
|