bizratr 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -1
- data/README.rdoc +4 -2
- data/lib/bizratr/connector.rb +29 -3
- data/lib/bizratr/version.rb +1 -1
- metadata +24 -28
- data/docs/BizRatr/Business.html +0 -981
- data/docs/BizRatr/Connector.html +0 -283
- data/docs/BizRatr/Finder.html +0 -348
- data/docs/BizRatr/FourSquareConnector.html +0 -294
- data/docs/BizRatr/GooglePlacesConnector.html +0 -293
- data/docs/BizRatr/YelpConnector.html +0 -299
- data/docs/BizRatr.html +0 -186
- data/docs/README_rdoc.html +0 -146
- data/docs/created.rid +0 -6
- data/docs/index.html +0 -128
- data/docs/lib/bizratr/business_rb.html +0 -52
- data/docs/lib/bizratr/connector_rb.html +0 -60
- data/docs/lib/bizratr/version_rb.html +0 -52
- data/docs/lib/bizratr_rb.html +0 -58
- data/docs/rdoc.css +0 -706
@@ -1,294 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
-
|
8
|
-
<title>Class: BizRatr::FourSquareConnector</title>
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
-
|
12
|
-
<script src="../js/jquery.js" type="text/javascript"
|
13
|
-
charset="utf-8"></script>
|
14
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
-
charset="utf-8"></script>
|
16
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
-
charset="utf-8"></script>
|
18
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
-
charset="utf-8"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
<body class="class">
|
23
|
-
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="../index.html">Home</a>
|
29
|
-
<a href="../index.html#classes">Classes</a>
|
30
|
-
<a href="../index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="file-metadata">
|
36
|
-
<div id="file-list-section" class="section">
|
37
|
-
<h3 class="section-header">In Files</h3>
|
38
|
-
<div class="section-body">
|
39
|
-
<ul>
|
40
|
-
|
41
|
-
<li><a href="../lib/bizratr/connector_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
-
class="thickbox" title="lib/bizratr/connector.rb">lib/bizratr/connector.rb</a></li>
|
43
|
-
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div id="class-metadata">
|
52
|
-
|
53
|
-
<!-- Parent Class -->
|
54
|
-
|
55
|
-
<div id="parent-class-section" class="section">
|
56
|
-
<h3 class="section-header">Parent</h3>
|
57
|
-
|
58
|
-
<p class="link"><a href="Connector.html">BizRatr::Connector</a></p>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
|
62
|
-
|
63
|
-
<!-- Namespace Contents -->
|
64
|
-
|
65
|
-
|
66
|
-
<!-- Method Quickref -->
|
67
|
-
|
68
|
-
<div id="method-list-section" class="section">
|
69
|
-
<h3 class="section-header">Methods</h3>
|
70
|
-
<ul class="link-list">
|
71
|
-
|
72
|
-
<li><a href="#method-c-new">::new</a></li>
|
73
|
-
|
74
|
-
<li><a href="#method-i-make_business">#make_business</a></li>
|
75
|
-
|
76
|
-
<li><a href="#method-i-search_location">#search_location</a></li>
|
77
|
-
|
78
|
-
</ul>
|
79
|
-
</div>
|
80
|
-
|
81
|
-
|
82
|
-
<!-- Included Modules -->
|
83
|
-
|
84
|
-
</div>
|
85
|
-
|
86
|
-
<div id="project-metadata">
|
87
|
-
|
88
|
-
|
89
|
-
<div id="fileindex-section" class="section project-section">
|
90
|
-
<h3 class="section-header">Files</h3>
|
91
|
-
<ul>
|
92
|
-
|
93
|
-
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
94
|
-
|
95
|
-
</ul>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
|
99
|
-
<div id="classindex-section" class="section project-section">
|
100
|
-
<h3 class="section-header">Class Index
|
101
|
-
<span class="search-toggle"><img src="../images/find.png"
|
102
|
-
height="16" width="16" alt="[+]"
|
103
|
-
title="show/hide quicksearch" /></span></h3>
|
104
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
105
|
-
<fieldset>
|
106
|
-
<legend>Quicksearch</legend>
|
107
|
-
<input type="text" name="quicksearch" value=""
|
108
|
-
class="quicksearch-field" />
|
109
|
-
</fieldset>
|
110
|
-
</form>
|
111
|
-
|
112
|
-
<ul class="link-list">
|
113
|
-
|
114
|
-
<li><a href="../BizRatr.html">BizRatr</a></li>
|
115
|
-
|
116
|
-
<li><a href="../BizRatr/Business.html">BizRatr::Business</a></li>
|
117
|
-
|
118
|
-
<li><a href="../BizRatr/Connector.html">BizRatr::Connector</a></li>
|
119
|
-
|
120
|
-
<li><a href="../BizRatr/Finder.html">BizRatr::Finder</a></li>
|
121
|
-
|
122
|
-
<li><a href="../BizRatr/FourSquareConnector.html">BizRatr::FourSquareConnector</a></li>
|
123
|
-
|
124
|
-
<li><a href="../BizRatr/GooglePlacesConnector.html">BizRatr::GooglePlacesConnector</a></li>
|
125
|
-
|
126
|
-
<li><a href="../BizRatr/YelpConnector.html">BizRatr::YelpConnector</a></li>
|
127
|
-
|
128
|
-
</ul>
|
129
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
130
|
-
</div>
|
131
|
-
|
132
|
-
|
133
|
-
</div>
|
134
|
-
</div>
|
135
|
-
|
136
|
-
<div id="documentation">
|
137
|
-
<h1 class="class">BizRatr::FourSquareConnector</h1>
|
138
|
-
|
139
|
-
<div id="description">
|
140
|
-
|
141
|
-
</div>
|
142
|
-
|
143
|
-
<!-- Constants -->
|
144
|
-
|
145
|
-
|
146
|
-
<!-- Attributes -->
|
147
|
-
|
148
|
-
|
149
|
-
<!-- Methods -->
|
150
|
-
|
151
|
-
<div id="public-class-method-details" class="method-section section">
|
152
|
-
<h3 class="section-header">Public Class Methods</h3>
|
153
|
-
|
154
|
-
|
155
|
-
<div id="new-method" class="method-detail ">
|
156
|
-
<a name="method-c-new"></a>
|
157
|
-
|
158
|
-
<div class="method-heading">
|
159
|
-
|
160
|
-
<span class="method-name">new</span><span
|
161
|
-
class="method-args">(config)</span>
|
162
|
-
<span class="method-click-advice">click to toggle source</span>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
<div class="method-description">
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
<div class="method-source-code"
|
173
|
-
id="new-source">
|
174
|
-
<pre>
|
175
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 48</span>
|
176
|
-
48: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">config</span>)
|
177
|
-
49: <span class="ruby-ivar">@client</span> = <span class="ruby-constant">Foursquare2</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">config</span>)
|
178
|
-
50: <span class="ruby-keyword kw">end</span></pre>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
</div>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
</div>
|
187
|
-
|
188
|
-
|
189
|
-
</div>
|
190
|
-
|
191
|
-
<div id="public-instance-method-details" class="method-section section">
|
192
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
193
|
-
|
194
|
-
|
195
|
-
<div id="make-business-method" class="method-detail ">
|
196
|
-
<a name="method-i-make_business"></a>
|
197
|
-
|
198
|
-
<div class="method-heading">
|
199
|
-
|
200
|
-
<span class="method-name">make_business</span><span
|
201
|
-
class="method-args">(item)</span>
|
202
|
-
<span class="method-click-advice">click to toggle source</span>
|
203
|
-
|
204
|
-
</div>
|
205
|
-
|
206
|
-
<div class="method-description">
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
<div class="method-source-code"
|
213
|
-
id="make-business-source">
|
214
|
-
<pre>
|
215
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 57</span>
|
216
|
-
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_business</span>(<span class="ruby-identifier">item</span>)
|
217
|
-
58: <span class="ruby-identifier">b</span> = <span class="ruby-constant">Business</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'lat'</span>], <span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'lng'</span>], <span class="ruby-identifier">item</span>[<span class="ruby-value str">'name'</span>])
|
218
|
-
59: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">add_id</span>(<span class="ruby-value">:foursquare</span>, <span class="ruby-identifier">item</span>[<span class="ruby-value str">'id'</span>])
|
219
|
-
60: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">phone</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'contact'</span>].<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'phone'</span>, <span class="ruby-keyword kw">nil</span>)
|
220
|
-
61: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">twitter</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'contact'</span>].<span class="ruby-identifier">fetch</span>(<span class="ruby-value str">'twitter'</span>, <span class="ruby-keyword kw">nil</span>)
|
221
|
-
62: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">state</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'state'</span>]
|
222
|
-
63: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">city</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'city'</span>]
|
223
|
-
64: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">country</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'cc'</span>]
|
224
|
-
65: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">address</span> = <span class="ruby-identifier">item</span>[<span class="ruby-value str">'location'</span>][<span class="ruby-value str">'address'</span>]
|
225
|
-
66: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">add_checkins</span>(<span class="ruby-value">:foursquare</span>, <span class="ruby-identifier">item</span>[<span class="ruby-value str">'stats'</span>][<span class="ruby-value str">'checkinsCount'</span>])
|
226
|
-
67: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">add_users</span>(<span class="ruby-value">:foursquare</span>, <span class="ruby-identifier">item</span>[<span class="ruby-value str">'stats'</span>][<span class="ruby-value str">'usersCount'</span>])
|
227
|
-
68: <span class="ruby-identifier">b</span>
|
228
|
-
69: <span class="ruby-keyword kw">end</span></pre>
|
229
|
-
</div>
|
230
|
-
|
231
|
-
</div>
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
</div>
|
237
|
-
|
238
|
-
|
239
|
-
<div id="search-location-method" class="method-detail ">
|
240
|
-
<a name="method-i-search_location"></a>
|
241
|
-
|
242
|
-
<div class="method-heading">
|
243
|
-
|
244
|
-
<span class="method-name">search_location</span><span
|
245
|
-
class="method-args">(ll, query)</span>
|
246
|
-
<span class="method-click-advice">click to toggle source</span>
|
247
|
-
|
248
|
-
</div>
|
249
|
-
|
250
|
-
<div class="method-description">
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
<div class="method-source-code"
|
257
|
-
id="search-location-source">
|
258
|
-
<pre>
|
259
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 52</span>
|
260
|
-
52: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">search_location</span>(<span class="ruby-identifier">ll</span>, <span class="ruby-identifier">query</span>)
|
261
|
-
53: <span class="ruby-identifier">results</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">search_venues</span>(<span class="ruby-value">:ll</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">ll</span>, <span class="ruby-value">:query</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">query</span>)
|
262
|
-
54: <span class="ruby-identifier">results</span>[<span class="ruby-value str">'groups'</span>].<span class="ruby-identifier">first</span>[<span class="ruby-value str">'items'</span>].<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">make_business</span>(<span class="ruby-identifier">item</span>) }
|
263
|
-
55: <span class="ruby-keyword kw">end</span></pre>
|
264
|
-
</div>
|
265
|
-
|
266
|
-
</div>
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
</div>
|
272
|
-
|
273
|
-
|
274
|
-
</div>
|
275
|
-
|
276
|
-
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
281
|
-
|
282
|
-
<p>Disabled; run with --debug to generate this.</p>
|
283
|
-
|
284
|
-
</div>
|
285
|
-
|
286
|
-
<div id="validator-badges">
|
287
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
288
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
289
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
290
|
-
</div>
|
291
|
-
|
292
|
-
</body>
|
293
|
-
</html>
|
294
|
-
|
@@ -1,293 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
-
|
8
|
-
<title>Class: BizRatr::GooglePlacesConnector</title>
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
|
11
|
-
|
12
|
-
<script src="../js/jquery.js" type="text/javascript"
|
13
|
-
charset="utf-8"></script>
|
14
|
-
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
15
|
-
charset="utf-8"></script>
|
16
|
-
<script src="../js/quicksearch.js" type="text/javascript"
|
17
|
-
charset="utf-8"></script>
|
18
|
-
<script src="../js/darkfish.js" type="text/javascript"
|
19
|
-
charset="utf-8"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
<body class="class">
|
23
|
-
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="../index.html">Home</a>
|
29
|
-
<a href="../index.html#classes">Classes</a>
|
30
|
-
<a href="../index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="file-metadata">
|
36
|
-
<div id="file-list-section" class="section">
|
37
|
-
<h3 class="section-header">In Files</h3>
|
38
|
-
<div class="section-body">
|
39
|
-
<ul>
|
40
|
-
|
41
|
-
<li><a href="../lib/bizratr/connector_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
-
class="thickbox" title="lib/bizratr/connector.rb">lib/bizratr/connector.rb</a></li>
|
43
|
-
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div id="class-metadata">
|
52
|
-
|
53
|
-
<!-- Parent Class -->
|
54
|
-
|
55
|
-
<div id="parent-class-section" class="section">
|
56
|
-
<h3 class="section-header">Parent</h3>
|
57
|
-
|
58
|
-
<p class="link"><a href="Connector.html">BizRatr::Connector</a></p>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
|
62
|
-
|
63
|
-
<!-- Namespace Contents -->
|
64
|
-
|
65
|
-
|
66
|
-
<!-- Method Quickref -->
|
67
|
-
|
68
|
-
<div id="method-list-section" class="section">
|
69
|
-
<h3 class="section-header">Methods</h3>
|
70
|
-
<ul class="link-list">
|
71
|
-
|
72
|
-
<li><a href="#method-c-new">::new</a></li>
|
73
|
-
|
74
|
-
<li><a href="#method-i-make_business">#make_business</a></li>
|
75
|
-
|
76
|
-
<li><a href="#method-i-search_location">#search_location</a></li>
|
77
|
-
|
78
|
-
</ul>
|
79
|
-
</div>
|
80
|
-
|
81
|
-
|
82
|
-
<!-- Included Modules -->
|
83
|
-
|
84
|
-
</div>
|
85
|
-
|
86
|
-
<div id="project-metadata">
|
87
|
-
|
88
|
-
|
89
|
-
<div id="fileindex-section" class="section project-section">
|
90
|
-
<h3 class="section-header">Files</h3>
|
91
|
-
<ul>
|
92
|
-
|
93
|
-
<li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
|
94
|
-
|
95
|
-
</ul>
|
96
|
-
</div>
|
97
|
-
|
98
|
-
|
99
|
-
<div id="classindex-section" class="section project-section">
|
100
|
-
<h3 class="section-header">Class Index
|
101
|
-
<span class="search-toggle"><img src="../images/find.png"
|
102
|
-
height="16" width="16" alt="[+]"
|
103
|
-
title="show/hide quicksearch" /></span></h3>
|
104
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
105
|
-
<fieldset>
|
106
|
-
<legend>Quicksearch</legend>
|
107
|
-
<input type="text" name="quicksearch" value=""
|
108
|
-
class="quicksearch-field" />
|
109
|
-
</fieldset>
|
110
|
-
</form>
|
111
|
-
|
112
|
-
<ul class="link-list">
|
113
|
-
|
114
|
-
<li><a href="../BizRatr.html">BizRatr</a></li>
|
115
|
-
|
116
|
-
<li><a href="../BizRatr/Business.html">BizRatr::Business</a></li>
|
117
|
-
|
118
|
-
<li><a href="../BizRatr/Connector.html">BizRatr::Connector</a></li>
|
119
|
-
|
120
|
-
<li><a href="../BizRatr/Finder.html">BizRatr::Finder</a></li>
|
121
|
-
|
122
|
-
<li><a href="../BizRatr/FourSquareConnector.html">BizRatr::FourSquareConnector</a></li>
|
123
|
-
|
124
|
-
<li><a href="../BizRatr/GooglePlacesConnector.html">BizRatr::GooglePlacesConnector</a></li>
|
125
|
-
|
126
|
-
<li><a href="../BizRatr/YelpConnector.html">BizRatr::YelpConnector</a></li>
|
127
|
-
|
128
|
-
</ul>
|
129
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
130
|
-
</div>
|
131
|
-
|
132
|
-
|
133
|
-
</div>
|
134
|
-
</div>
|
135
|
-
|
136
|
-
<div id="documentation">
|
137
|
-
<h1 class="class">BizRatr::GooglePlacesConnector</h1>
|
138
|
-
|
139
|
-
<div id="description">
|
140
|
-
|
141
|
-
</div>
|
142
|
-
|
143
|
-
<!-- Constants -->
|
144
|
-
|
145
|
-
|
146
|
-
<!-- Attributes -->
|
147
|
-
|
148
|
-
|
149
|
-
<!-- Methods -->
|
150
|
-
|
151
|
-
<div id="public-class-method-details" class="method-section section">
|
152
|
-
<h3 class="section-header">Public Class Methods</h3>
|
153
|
-
|
154
|
-
|
155
|
-
<div id="new-method" class="method-detail ">
|
156
|
-
<a name="method-c-new"></a>
|
157
|
-
|
158
|
-
<div class="method-heading">
|
159
|
-
|
160
|
-
<span class="method-name">new</span><span
|
161
|
-
class="method-args">(config)</span>
|
162
|
-
<span class="method-click-advice">click to toggle source</span>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
|
166
|
-
<div class="method-description">
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
<div class="method-source-code"
|
173
|
-
id="new-source">
|
174
|
-
<pre>
|
175
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 24</span>
|
176
|
-
24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">config</span>)
|
177
|
-
25: <span class="ruby-ivar">@client</span> = <span class="ruby-constant">GooglePlaces</span><span class="ruby-operator">::</span><span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:key</span>])
|
178
|
-
26: <span class="ruby-keyword kw">end</span></pre>
|
179
|
-
</div>
|
180
|
-
|
181
|
-
</div>
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
</div>
|
187
|
-
|
188
|
-
|
189
|
-
</div>
|
190
|
-
|
191
|
-
<div id="public-instance-method-details" class="method-section section">
|
192
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
193
|
-
|
194
|
-
|
195
|
-
<div id="make-business-method" class="method-detail ">
|
196
|
-
<a name="method-i-make_business"></a>
|
197
|
-
|
198
|
-
<div class="method-heading">
|
199
|
-
|
200
|
-
<span class="method-name">make_business</span><span
|
201
|
-
class="method-args">(item)</span>
|
202
|
-
<span class="method-click-advice">click to toggle source</span>
|
203
|
-
|
204
|
-
</div>
|
205
|
-
|
206
|
-
<div class="method-description">
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
<div class="method-source-code"
|
213
|
-
id="make-business-source">
|
214
|
-
<pre>
|
215
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 34</span>
|
216
|
-
34: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_business</span>(<span class="ruby-identifier">item</span>)
|
217
|
-
35: <span class="ruby-identifier">b</span> = <span class="ruby-constant">Business</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">item</span>.<span class="ruby-identifier">lat</span>, <span class="ruby-identifier">item</span>.<span class="ruby-identifier">lng</span>, <span class="ruby-identifier">item</span>.<span class="ruby-identifier">name</span>)
|
218
|
-
36: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">add_id</span>(<span class="ruby-value">:google_places</span>, <span class="ruby-identifier">item</span>.<span class="ruby-identifier">id</span>)
|
219
|
-
37: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">phone</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">formatted_phone_number</span>
|
220
|
-
38: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">city</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">city</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">vicinity</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">last</span>
|
221
|
-
39: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">country</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">country</span>
|
222
|
-
40: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">zip</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">postal_code</span>
|
223
|
-
41: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">address</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">vicinity</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>).<span class="ruby-identifier">first</span>
|
224
|
-
42: <span class="ruby-identifier">b</span>.<span class="ruby-identifier">add_rating</span>(<span class="ruby-value">:google_places</span>, <span class="ruby-identifier">item</span>.<span class="ruby-identifier">rating</span>)
|
225
|
-
43: <span class="ruby-identifier">b</span>
|
226
|
-
44: <span class="ruby-keyword kw">end</span></pre>
|
227
|
-
</div>
|
228
|
-
|
229
|
-
</div>
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
</div>
|
235
|
-
|
236
|
-
|
237
|
-
<div id="search-location-method" class="method-detail ">
|
238
|
-
<a name="method-i-search_location"></a>
|
239
|
-
|
240
|
-
<div class="method-heading">
|
241
|
-
|
242
|
-
<span class="method-name">search_location</span><span
|
243
|
-
class="method-args">(ll, query)</span>
|
244
|
-
<span class="method-click-advice">click to toggle source</span>
|
245
|
-
|
246
|
-
</div>
|
247
|
-
|
248
|
-
<div class="method-description">
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
<div class="method-source-code"
|
255
|
-
id="search-location-source">
|
256
|
-
<pre>
|
257
|
-
<span class="ruby-comment cmt"># File lib/bizratr/connector.rb, line 28</span>
|
258
|
-
28: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">search_location</span>(<span class="ruby-identifier">ll</span>, <span class="ruby-identifier">query</span>)
|
259
|
-
29: <span class="ruby-identifier">coords</span> = <span class="ruby-identifier">ll</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">','</span>)
|
260
|
-
30: <span class="ruby-identifier">results</span> = <span class="ruby-ivar">@client</span>.<span class="ruby-identifier">spots</span>(<span class="ruby-identifier">coords</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_f</span>, <span class="ruby-identifier">coords</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_f</span>, <span class="ruby-value">:name</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">query</span>)
|
261
|
-
31: <span class="ruby-identifier">results</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span> <span class="ruby-identifier">make_business</span>(<span class="ruby-identifier">item</span>) }
|
262
|
-
32: <span class="ruby-keyword kw">end</span></pre>
|
263
|
-
</div>
|
264
|
-
|
265
|
-
</div>
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
</div>
|
271
|
-
|
272
|
-
|
273
|
-
</div>
|
274
|
-
|
275
|
-
|
276
|
-
</div>
|
277
|
-
|
278
|
-
|
279
|
-
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
280
|
-
|
281
|
-
<p>Disabled; run with --debug to generate this.</p>
|
282
|
-
|
283
|
-
</div>
|
284
|
-
|
285
|
-
<div id="validator-badges">
|
286
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
287
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
288
|
-
Rdoc Generator</a> 1.1.6</small>.</p>
|
289
|
-
</div>
|
290
|
-
|
291
|
-
</body>
|
292
|
-
</html>
|
293
|
-
|