espresso_path 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/espresso_path/client.rb +64 -13
- data/lib/espresso_path/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c196fb46dcd16c49fd44b559427d37646dbbe149
|
4
|
+
data.tar.gz: 4a81ee522958f17fb0c77f2a329af9783398b388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f32ab8d883a0690a042ae1b3181f3e134d448a779f34dfe45ad62e10132f046a402b50b77bde3cd8cd4fc894b48793c5966b4d1adb54fea6cda353c578c65e1e
|
7
|
+
data.tar.gz: b404c5ae1d945f192e9dbf4cc76b4cec6ae8dd97cb0214420a0513407c6c62ba1371cdb74ebfd8c2e038745fbdb8ff4fe6fd7024c5c3ce509549210997e8af9a
|
data/lib/espresso_path/client.rb
CHANGED
@@ -3,6 +3,8 @@ require 'httparty'
|
|
3
3
|
require 'json'
|
4
4
|
|
5
5
|
module EspressoPath
|
6
|
+
##
|
7
|
+
# This class is the base client for the API
|
6
8
|
class Client
|
7
9
|
include HTTParty
|
8
10
|
|
@@ -24,16 +26,23 @@ module EspressoPath
|
|
24
26
|
@options = {
|
25
27
|
headers: {
|
26
28
|
Authorization: "Bearer #{@access_token}"
|
27
|
-
}
|
29
|
+
},
|
30
|
+
|
28
31
|
}
|
29
32
|
end
|
30
33
|
|
34
|
+
def map_services(type, level, ids, options = @options)
|
35
|
+
options[:query] = { ids: ids}
|
36
|
+
puts options.inspect
|
37
|
+
self.class.get("/mapservices/#{type}/#{level}", @options)
|
38
|
+
end
|
39
|
+
|
31
40
|
def audience
|
32
41
|
self.class.get('/audience', @options)
|
33
42
|
end
|
34
43
|
|
35
|
-
def
|
36
|
-
self.class.get('/
|
44
|
+
def census_tracts
|
45
|
+
self.class.get('/census-tracts', @options)
|
37
46
|
end
|
38
47
|
|
39
48
|
def counties
|
@@ -44,32 +53,74 @@ module EspressoPath
|
|
44
53
|
self.class.get('/custom-demos', @options)
|
45
54
|
end
|
46
55
|
|
47
|
-
def
|
48
|
-
self.class.get('/
|
56
|
+
def custom_markets
|
57
|
+
self.class.get('/custom-markets', @options)
|
49
58
|
end
|
50
59
|
|
51
|
-
def
|
52
|
-
self.class.get('/
|
60
|
+
def day_parts
|
61
|
+
self.class.get('/day-parts', @options)
|
53
62
|
end
|
54
63
|
|
55
|
-
def
|
56
|
-
self.class.get(
|
64
|
+
def day_part(id)
|
65
|
+
self.class.get("/day-parts/#{id}", @options)
|
57
66
|
end
|
58
67
|
|
59
|
-
def
|
60
|
-
self.class.get('/
|
68
|
+
def demos
|
69
|
+
self.class.get('/demos/categories', @options)
|
70
|
+
end
|
71
|
+
|
72
|
+
def demo_subcategories(id)
|
73
|
+
self.class.get("/demos/demo_subcategories/#{id}/demo", @options)
|
61
74
|
end
|
62
75
|
|
63
76
|
def market(market)
|
64
77
|
self.class.get("/markets/#{market}", @options)
|
65
78
|
end
|
66
79
|
|
80
|
+
def markets
|
81
|
+
self.class.get('/markets', @options)
|
82
|
+
end
|
83
|
+
|
84
|
+
# Get all the MediaTypes
|
85
|
+
def media_types
|
86
|
+
self.class.get('/media-types', @options)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Get the MediaType referenced by the ID
|
90
|
+
# # ==== Attributes
|
91
|
+
#
|
92
|
+
# * +id+ - The id of the object you wish to retrieve.
|
93
|
+
def media_type(id)
|
94
|
+
self.class.get("/media-types/#{id}", @options)
|
95
|
+
end
|
96
|
+
|
97
|
+
def operators
|
98
|
+
self.class.get('/operators', @options)
|
99
|
+
end
|
100
|
+
|
101
|
+
def panel_sets
|
102
|
+
self.class.get('/panel-sets', @options)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Get all the panels
|
67
106
|
def panels
|
68
107
|
self.class.get('/panels', @options)
|
69
108
|
end
|
70
109
|
|
71
|
-
def
|
72
|
-
self.class.get(
|
110
|
+
def panel(id)
|
111
|
+
self.class.get("/panels/#{id}", @options)
|
112
|
+
end
|
113
|
+
|
114
|
+
def panels_nearby
|
115
|
+
self.class.get('/panels/nearby', @options)
|
116
|
+
end
|
117
|
+
|
118
|
+
def plants
|
119
|
+
self.class.get('/plants', @options)
|
120
|
+
end
|
121
|
+
|
122
|
+
def plant(id)
|
123
|
+
self.class.get("/plants/#{id}", @options)
|
73
124
|
end
|
74
125
|
|
75
126
|
def states
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: espresso_path
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KickinEspresso
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|