bizratr 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,981 +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::Business</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/business_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/bizratr/business.rb">lib/bizratr/business.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">Object</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-%3D%3D">#==</a></li>
75
-
76
- <li><a href="#method-i-add_checkins">#add_checkins</a></li>
77
-
78
- <li><a href="#method-i-add_id">#add_id</a></li>
79
-
80
- <li><a href="#method-i-add_likes">#add_likes</a></li>
81
-
82
- <li><a href="#method-i-add_rating">#add_rating</a></li>
83
-
84
- <li><a href="#method-i-add_review_counts">#add_review_counts</a></li>
85
-
86
- <li><a href="#method-i-add_users">#add_users</a></li>
87
-
88
- <li><a href="#method-i-any_equal_ids%3F">#any_equal_ids?</a></li>
89
-
90
- <li><a href="#method-i-distance_to">#distance_to</a></li>
91
-
92
- <li><a href="#method-i-merge">#merge</a></li>
93
-
94
- <li><a href="#method-i-name_distance_to">#name_distance_to</a></li>
95
-
96
- <li><a href="#method-i-rating">#rating</a></li>
97
-
98
- <li><a href="#method-i-to_s">#to_s</a></li>
99
-
100
- </ul>
101
- </div>
102
-
103
-
104
- <!-- Included Modules -->
105
-
106
- </div>
107
-
108
- <div id="project-metadata">
109
-
110
-
111
- <div id="fileindex-section" class="section project-section">
112
- <h3 class="section-header">Files</h3>
113
- <ul>
114
-
115
- <li class="file"><a href="../README_rdoc.html">README.rdoc</a></li>
116
-
117
- </ul>
118
- </div>
119
-
120
-
121
- <div id="classindex-section" class="section project-section">
122
- <h3 class="section-header">Class Index
123
- <span class="search-toggle"><img src="../images/find.png"
124
- height="16" width="16" alt="[+]"
125
- title="show/hide quicksearch" /></span></h3>
126
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
127
- <fieldset>
128
- <legend>Quicksearch</legend>
129
- <input type="text" name="quicksearch" value=""
130
- class="quicksearch-field" />
131
- </fieldset>
132
- </form>
133
-
134
- <ul class="link-list">
135
-
136
- <li><a href="../BizRatr.html">BizRatr</a></li>
137
-
138
- <li><a href="../BizRatr/Business.html">BizRatr::Business</a></li>
139
-
140
- <li><a href="../BizRatr/Connector.html">BizRatr::Connector</a></li>
141
-
142
- <li><a href="../BizRatr/Finder.html">BizRatr::Finder</a></li>
143
-
144
- <li><a href="../BizRatr/FourSquareConnector.html">BizRatr::FourSquareConnector</a></li>
145
-
146
- <li><a href="../BizRatr/GooglePlacesConnector.html">BizRatr::GooglePlacesConnector</a></li>
147
-
148
- <li><a href="../BizRatr/YelpConnector.html">BizRatr::YelpConnector</a></li>
149
-
150
- </ul>
151
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
152
- </div>
153
-
154
-
155
- </div>
156
- </div>
157
-
158
- <div id="documentation">
159
- <h1 class="class">BizRatr::Business</h1>
160
-
161
- <div id="description">
162
-
163
- </div>
164
-
165
- <!-- Constants -->
166
-
167
-
168
- <!-- Attributes -->
169
-
170
- <div id="attribute-method-details" class="method-section section">
171
- <h3 class="section-header">Attributes</h3>
172
-
173
-
174
- <div id="name-attribute-method" class="method-detail">
175
- <a name="name"></a>
176
-
177
- <a name="name="></a>
178
-
179
- <div class="method-heading attribute-method-heading">
180
- <span class="method-name">name</span><span
181
- class="attribute-access-type">[RW]</span>
182
- </div>
183
-
184
- <div class="method-description">
185
-
186
-
187
-
188
- </div>
189
- </div>
190
-
191
- <div id="phone-attribute-method" class="method-detail">
192
- <a name="phone"></a>
193
-
194
- <a name="phone="></a>
195
-
196
- <div class="method-heading attribute-method-heading">
197
- <span class="method-name">phone</span><span
198
- class="attribute-access-type">[RW]</span>
199
- </div>
200
-
201
- <div class="method-description">
202
-
203
-
204
-
205
- </div>
206
- </div>
207
-
208
- <div id="address-attribute-method" class="method-detail">
209
- <a name="address"></a>
210
-
211
- <a name="address="></a>
212
-
213
- <div class="method-heading attribute-method-heading">
214
- <span class="method-name">address</span><span
215
- class="attribute-access-type">[RW]</span>
216
- </div>
217
-
218
- <div class="method-description">
219
-
220
-
221
-
222
- </div>
223
- </div>
224
-
225
- <div id="state-attribute-method" class="method-detail">
226
- <a name="state"></a>
227
-
228
- <a name="state="></a>
229
-
230
- <div class="method-heading attribute-method-heading">
231
- <span class="method-name">state</span><span
232
- class="attribute-access-type">[RW]</span>
233
- </div>
234
-
235
- <div class="method-description">
236
-
237
-
238
-
239
- </div>
240
- </div>
241
-
242
- <div id="country-attribute-method" class="method-detail">
243
- <a name="country"></a>
244
-
245
- <a name="country="></a>
246
-
247
- <div class="method-heading attribute-method-heading">
248
- <span class="method-name">country</span><span
249
- class="attribute-access-type">[RW]</span>
250
- </div>
251
-
252
- <div class="method-description">
253
-
254
-
255
-
256
- </div>
257
- </div>
258
-
259
- <div id="zip-attribute-method" class="method-detail">
260
- <a name="zip"></a>
261
-
262
- <a name="zip="></a>
263
-
264
- <div class="method-heading attribute-method-heading">
265
- <span class="method-name">zip</span><span
266
- class="attribute-access-type">[RW]</span>
267
- </div>
268
-
269
- <div class="method-description">
270
-
271
-
272
-
273
- </div>
274
- </div>
275
-
276
- <div id="twitter-attribute-method" class="method-detail">
277
- <a name="twitter"></a>
278
-
279
- <a name="twitter="></a>
280
-
281
- <div class="method-heading attribute-method-heading">
282
- <span class="method-name">twitter</span><span
283
- class="attribute-access-type">[RW]</span>
284
- </div>
285
-
286
- <div class="method-description">
287
-
288
-
289
-
290
- </div>
291
- </div>
292
-
293
- <div id="ids-attribute-method" class="method-detail">
294
- <a name="ids"></a>
295
-
296
- <a name="ids="></a>
297
-
298
- <div class="method-heading attribute-method-heading">
299
- <span class="method-name">ids</span><span
300
- class="attribute-access-type">[RW]</span>
301
- </div>
302
-
303
- <div class="method-description">
304
-
305
-
306
-
307
- </div>
308
- </div>
309
-
310
- <div id="checkins-attribute-method" class="method-detail">
311
- <a name="checkins"></a>
312
-
313
- <a name="checkins="></a>
314
-
315
- <div class="method-heading attribute-method-heading">
316
- <span class="method-name">checkins</span><span
317
- class="attribute-access-type">[RW]</span>
318
- </div>
319
-
320
- <div class="method-description">
321
-
322
-
323
-
324
- </div>
325
- </div>
326
-
327
- <div id="users-attribute-method" class="method-detail">
328
- <a name="users"></a>
329
-
330
- <a name="users="></a>
331
-
332
- <div class="method-heading attribute-method-heading">
333
- <span class="method-name">users</span><span
334
- class="attribute-access-type">[RW]</span>
335
- </div>
336
-
337
- <div class="method-description">
338
-
339
-
340
-
341
- </div>
342
- </div>
343
-
344
- <div id="likes-attribute-method" class="method-detail">
345
- <a name="likes"></a>
346
-
347
- <a name="likes="></a>
348
-
349
- <div class="method-heading attribute-method-heading">
350
- <span class="method-name">likes</span><span
351
- class="attribute-access-type">[RW]</span>
352
- </div>
353
-
354
- <div class="method-description">
355
-
356
-
357
-
358
- </div>
359
- </div>
360
-
361
- <div id="ratings-attribute-method" class="method-detail">
362
- <a name="ratings"></a>
363
-
364
- <a name="ratings="></a>
365
-
366
- <div class="method-heading attribute-method-heading">
367
- <span class="method-name">ratings</span><span
368
- class="attribute-access-type">[RW]</span>
369
- </div>
370
-
371
- <div class="method-description">
372
-
373
-
374
-
375
- </div>
376
- </div>
377
-
378
- <div id="review-counts-attribute-method" class="method-detail">
379
- <a name="review_counts"></a>
380
-
381
- <a name="review_counts="></a>
382
-
383
- <div class="method-heading attribute-method-heading">
384
- <span class="method-name">review_counts</span><span
385
- class="attribute-access-type">[RW]</span>
386
- </div>
387
-
388
- <div class="method-description">
389
-
390
-
391
-
392
- </div>
393
- </div>
394
-
395
- <div id="coords-attribute-method" class="method-detail">
396
- <a name="coords"></a>
397
-
398
- <a name="coords="></a>
399
-
400
- <div class="method-heading attribute-method-heading">
401
- <span class="method-name">coords</span><span
402
- class="attribute-access-type">[RW]</span>
403
- </div>
404
-
405
- <div class="method-description">
406
-
407
-
408
-
409
- </div>
410
- </div>
411
-
412
- <div id="city-attribute-method" class="method-detail">
413
- <a name="city"></a>
414
-
415
- <a name="city="></a>
416
-
417
- <div class="method-heading attribute-method-heading">
418
- <span class="method-name">city</span><span
419
- class="attribute-access-type">[RW]</span>
420
- </div>
421
-
422
- <div class="method-description">
423
-
424
-
425
-
426
- </div>
427
- </div>
428
-
429
- </div>
430
-
431
-
432
- <!-- Methods -->
433
-
434
- <div id="public-class-method-details" class="method-section section">
435
- <h3 class="section-header">Public Class Methods</h3>
436
-
437
-
438
- <div id="new-method" class="method-detail ">
439
- <a name="method-c-new"></a>
440
-
441
- <div class="method-heading">
442
-
443
- <span class="method-name">new</span><span
444
- class="method-args">(lat, lon, name)</span>
445
- <span class="method-click-advice">click to toggle source</span>
446
-
447
- </div>
448
-
449
- <div class="method-description">
450
-
451
-
452
-
453
-
454
-
455
- <div class="method-source-code"
456
- id="new-source">
457
- <pre>
458
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 5</span>
459
- 5: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">lat</span>, <span class="ruby-identifier">lon</span>, <span class="ruby-identifier">name</span>)
460
- 6: <span class="ruby-ivar">@ids</span> = {}
461
- 7: <span class="ruby-ivar">@checkins</span> = {}
462
- 8: <span class="ruby-ivar">@users</span> = {}
463
- 9: <span class="ruby-ivar">@likes</span> = {}
464
- 10: <span class="ruby-ivar">@ratings</span> = {}
465
- 11: <span class="ruby-ivar">@review_counts</span> = {}
466
- 12: <span class="ruby-ivar">@coords</span> = [<span class="ruby-identifier">lat</span>, <span class="ruby-identifier">lon</span>]
467
- 13: <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>
468
- 14: <span class="ruby-keyword kw">end</span></pre>
469
- </div>
470
-
471
- </div>
472
-
473
-
474
-
475
-
476
- </div>
477
-
478
-
479
- </div>
480
-
481
- <div id="public-instance-method-details" class="method-section section">
482
- <h3 class="section-header">Public Instance Methods</h3>
483
-
484
-
485
- <div id="--method" class="method-detail ">
486
- <a name="method-i-%3D%3D"></a>
487
-
488
- <div class="method-heading">
489
-
490
- <span class="method-name">==</span><span
491
- class="method-args">(other)</span>
492
- <span class="method-click-advice">click to toggle source</span>
493
-
494
- </div>
495
-
496
- <div class="method-description">
497
-
498
-
499
-
500
-
501
-
502
- <div class="method-source-code"
503
- id="--source">
504
- <pre>
505
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 94</span>
506
- 94: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">other</span>)
507
- 95: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">nil?</span>
508
- 96: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">any_equal_ids?</span>(<span class="ruby-identifier">other</span>)
509
- 97: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@phone</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">phone</span> <span class="ruby-keyword kw">and</span> <span class="ruby-keyword kw">not</span> <span class="ruby-ivar">@phone</span>.<span class="ruby-identifier">nil?</span>
510
- 98: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">distance_to</span>(<span class="ruby-identifier">other</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-value">0.3</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">name_distance_to</span>(<span class="ruby-identifier">other</span>) <span class="ruby-operator">&lt;</span> <span class="ruby-value">0.4</span>
511
- 99: <span class="ruby-keyword kw">false</span>
512
- 100: <span class="ruby-keyword kw">end</span></pre>
513
- </div>
514
-
515
- </div>
516
-
517
-
518
-
519
-
520
- </div>
521
-
522
-
523
- <div id="add-checkins-method" class="method-detail ">
524
- <a name="method-i-add_checkins"></a>
525
-
526
- <div class="method-heading">
527
-
528
- <span class="method-name">add_checkins</span><span
529
- class="method-args">(connector, checkins)</span>
530
- <span class="method-click-advice">click to toggle source</span>
531
-
532
- </div>
533
-
534
- <div class="method-description">
535
-
536
-
537
-
538
-
539
-
540
- <div class="method-source-code"
541
- id="add-checkins-source">
542
- <pre>
543
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 49</span>
544
- 49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_checkins</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">checkins</span>)
545
- 50: <span class="ruby-ivar">@checkins</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">checkins</span>
546
- 51: <span class="ruby-keyword kw">end</span></pre>
547
- </div>
548
-
549
- </div>
550
-
551
-
552
-
553
-
554
- </div>
555
-
556
-
557
- <div id="add-id-method" class="method-detail ">
558
- <a name="method-i-add_id"></a>
559
-
560
- <div class="method-heading">
561
-
562
- <span class="method-name">add_id</span><span
563
- class="method-args">(connector, id)</span>
564
- <span class="method-click-advice">click to toggle source</span>
565
-
566
- </div>
567
-
568
- <div class="method-description">
569
-
570
-
571
-
572
-
573
-
574
- <div class="method-source-code"
575
- id="add-id-source">
576
- <pre>
577
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 45</span>
578
- 45: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_id</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">id</span>)
579
- 46: <span class="ruby-ivar">@ids</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">id</span>
580
- 47: <span class="ruby-keyword kw">end</span></pre>
581
- </div>
582
-
583
- </div>
584
-
585
-
586
-
587
-
588
- </div>
589
-
590
-
591
- <div id="add-likes-method" class="method-detail ">
592
- <a name="method-i-add_likes"></a>
593
-
594
- <div class="method-heading">
595
-
596
- <span class="method-name">add_likes</span><span
597
- class="method-args">(connector, likes)</span>
598
- <span class="method-click-advice">click to toggle source</span>
599
-
600
- </div>
601
-
602
- <div class="method-description">
603
-
604
-
605
-
606
-
607
-
608
- <div class="method-source-code"
609
- id="add-likes-source">
610
- <pre>
611
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 57</span>
612
- 57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_likes</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">likes</span>)
613
- 58: <span class="ruby-ivar">@users</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">likes</span>
614
- 59: <span class="ruby-keyword kw">end</span></pre>
615
- </div>
616
-
617
- </div>
618
-
619
-
620
-
621
-
622
- </div>
623
-
624
-
625
- <div id="add-rating-method" class="method-detail ">
626
- <a name="method-i-add_rating"></a>
627
-
628
- <div class="method-heading">
629
-
630
- <span class="method-name">add_rating</span><span
631
- class="method-args">(connector, rating)</span>
632
- <span class="method-click-advice">click to toggle source</span>
633
-
634
- </div>
635
-
636
- <div class="method-description">
637
-
638
-
639
-
640
-
641
-
642
- <div class="method-source-code"
643
- id="add-rating-source">
644
- <pre>
645
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 61</span>
646
- 61: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_rating</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">rating</span>)
647
- 62: <span class="ruby-ivar">@ratings</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">rating</span>
648
- 63: <span class="ruby-keyword kw">end</span></pre>
649
- </div>
650
-
651
- </div>
652
-
653
-
654
-
655
-
656
- </div>
657
-
658
-
659
- <div id="add-review-counts-method" class="method-detail ">
660
- <a name="method-i-add_review_counts"></a>
661
-
662
- <div class="method-heading">
663
-
664
- <span class="method-name">add_review_counts</span><span
665
- class="method-args">(connector, counts)</span>
666
- <span class="method-click-advice">click to toggle source</span>
667
-
668
- </div>
669
-
670
- <div class="method-description">
671
-
672
-
673
-
674
-
675
-
676
- <div class="method-source-code"
677
- id="add-review-counts-source">
678
- <pre>
679
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 65</span>
680
- 65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_review_counts</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">counts</span>)
681
- 66: <span class="ruby-ivar">@review_counts</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">counts</span>
682
- 67: <span class="ruby-keyword kw">end</span></pre>
683
- </div>
684
-
685
- </div>
686
-
687
-
688
-
689
-
690
- </div>
691
-
692
-
693
- <div id="add-users-method" class="method-detail ">
694
- <a name="method-i-add_users"></a>
695
-
696
- <div class="method-heading">
697
-
698
- <span class="method-name">add_users</span><span
699
- class="method-args">(connector, users)</span>
700
- <span class="method-click-advice">click to toggle source</span>
701
-
702
- </div>
703
-
704
- <div class="method-description">
705
-
706
-
707
-
708
-
709
-
710
- <div class="method-source-code"
711
- id="add-users-source">
712
- <pre>
713
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 53</span>
714
- 53: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_users</span>(<span class="ruby-identifier">connector</span>, <span class="ruby-identifier">users</span>)
715
- 54: <span class="ruby-ivar">@users</span>[<span class="ruby-identifier">connector</span>] = <span class="ruby-identifier">users</span>
716
- 55: <span class="ruby-keyword kw">end</span></pre>
717
- </div>
718
-
719
- </div>
720
-
721
-
722
-
723
-
724
- </div>
725
-
726
-
727
- <div id="any-equal-ids--method" class="method-detail ">
728
- <a name="method-i-any_equal_ids%3F"></a>
729
-
730
- <div class="method-heading">
731
-
732
- <span class="method-name">any_equal_ids?</span><span
733
- class="method-args">(other)</span>
734
- <span class="method-click-advice">click to toggle source</span>
735
-
736
- </div>
737
-
738
- <div class="method-description">
739
-
740
-
741
-
742
-
743
-
744
- <div class="method-source-code"
745
- id="any-equal-ids--source">
746
- <pre>
747
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 69</span>
748
- 69: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">any_equal_ids?</span>(<span class="ruby-identifier">other</span>)
749
- 70: <span class="ruby-ivar">@ids</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
750
- 71: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">ids</span>[<span class="ruby-identifier">k</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">v</span>
751
- 72: }
752
- 73: <span class="ruby-keyword kw">false</span>
753
- 74: <span class="ruby-keyword kw">end</span></pre>
754
- </div>
755
-
756
- </div>
757
-
758
-
759
-
760
-
761
- </div>
762
-
763
-
764
- <div id="distance-to-method" class="method-detail ">
765
- <a name="method-i-distance_to"></a>
766
-
767
- <div class="method-heading">
768
-
769
- <span class="method-name">distance_to</span><span
770
- class="method-args">(other)</span>
771
- <span class="method-click-advice">click to toggle source</span>
772
-
773
- </div>
774
-
775
- <div class="method-description">
776
-
777
-
778
-
779
-
780
-
781
- <div class="method-source-code"
782
- id="distance-to-source">
783
- <pre>
784
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 76</span>
785
- 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">distance_to</span>(<span class="ruby-identifier">other</span>)
786
- 77: <span class="ruby-identifier">rpd</span> = <span class="ruby-value">0.017453293</span> <span class="ruby-comment cmt"># PI/180</span>
787
- 78: <span class="ruby-identifier">dlat</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@coords</span>[<span class="ruby-value">0</span>]
788
- 79: <span class="ruby-identifier">dlon</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">-</span> <span class="ruby-ivar">@coords</span>[<span class="ruby-value">1</span>]
789
- 80: <span class="ruby-identifier">dlon_rad</span> = <span class="ruby-identifier">dlon</span> * <span class="ruby-identifier">rpd</span>
790
- 81: <span class="ruby-identifier">dlat_rad</span> = <span class="ruby-identifier">dlat</span> * <span class="ruby-identifier">rpd</span>
791
- 82: <span class="ruby-identifier">lat1_rad</span> = <span class="ruby-ivar">@coords</span>[<span class="ruby-value">0</span>] * <span class="ruby-identifier">rpd</span>
792
- 83: <span class="ruby-identifier">lon1_rad</span> = <span class="ruby-ivar">@coords</span>[<span class="ruby-value">1</span>] * <span class="ruby-identifier">rpd</span>
793
- 84: <span class="ruby-identifier">lat2_rad</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">0</span>] * <span class="ruby-identifier">rpd</span>
794
- 85: <span class="ruby-identifier">lon2_rad</span> = <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">1</span>] * <span class="ruby-identifier">rpd</span>
795
- 86: <span class="ruby-identifier">a</span> = (<span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">dlat_rad</span><span class="ruby-operator">/</span><span class="ruby-value">2</span>))<span class="ruby-operator">**</span><span class="ruby-value">2</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">lat1_rad</span>) * <span class="ruby-constant">Math</span>.<span class="ruby-identifier">cos</span>(<span class="ruby-identifier">lat2_rad</span>) * (<span class="ruby-constant">Math</span>.<span class="ruby-identifier">sin</span>(<span class="ruby-identifier">dlon_rad</span><span class="ruby-operator">/</span><span class="ruby-value">2</span>))<span class="ruby-operator">**</span><span class="ruby-value">2</span>
796
- 87: <span class="ruby-value">2</span> * <span class="ruby-constant">Math</span>.<span class="ruby-identifier">atan2</span>( <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-identifier">a</span>), <span class="ruby-constant">Math</span>.<span class="ruby-identifier">sqrt</span>(<span class="ruby-value">1</span><span class="ruby-operator">-</span><span class="ruby-identifier">a</span>)) * <span class="ruby-value">3956</span> <span class="ruby-comment cmt"># 3956 is the radius of the great circle in miles</span>
797
- 88: <span class="ruby-keyword kw">end</span></pre>
798
- </div>
799
-
800
- </div>
801
-
802
-
803
-
804
-
805
- </div>
806
-
807
-
808
- <div id="merge-method" class="method-detail ">
809
- <a name="method-i-merge"></a>
810
-
811
- <div class="method-heading">
812
-
813
- <span class="method-name">merge</span><span
814
- class="method-args">(other)</span>
815
- <span class="method-click-advice">click to toggle source</span>
816
-
817
- </div>
818
-
819
- <div class="method-description">
820
-
821
-
822
-
823
-
824
-
825
- <div class="method-source-code"
826
- id="merge-source">
827
- <pre>
828
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 26</span>
829
- 26: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>)
830
- 27: <span class="ruby-ivar">@ids</span> = <span class="ruby-ivar">@ids</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">ids</span>)
831
- 28: <span class="ruby-ivar">@phone</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">phone</span>
832
- 29: <span class="ruby-ivar">@address</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">address</span>
833
- 30: <span class="ruby-ivar">@state</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">state</span>
834
- 31: <span class="ruby-ivar">@country</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">country</span>
835
- 32: <span class="ruby-ivar">@zip</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">zip</span>
836
- 33: <span class="ruby-ivar">@twitter</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">twitter</span>
837
- 34: <span class="ruby-ivar">@city</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">city</span>
838
- 35: <span class="ruby-ivar">@checkins</span> = <span class="ruby-ivar">@checkins</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">checkins</span>)
839
- 36: <span class="ruby-ivar">@users</span> = <span class="ruby-ivar">@users</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">users</span>)
840
- 37: <span class="ruby-ivar">@likes</span> = <span class="ruby-ivar">@likes</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">likes</span>)
841
- 38: <span class="ruby-ivar">@ratings</span> = <span class="ruby-ivar">@ratings</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">ratings</span>)
842
- 39: <span class="ruby-ivar">@review_counts</span> = <span class="ruby-ivar">@review_counts</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">review_counts</span>)
843
- 40: <span class="ruby-ivar">@coords</span>[<span class="ruby-value">0</span>] = (<span class="ruby-ivar">@coords</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">/</span> <span class="ruby-value">2.0</span>
844
- 41: <span class="ruby-ivar">@coords</span>[<span class="ruby-value">1</span>] = (<span class="ruby-ivar">@coords</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_f</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">coords</span>[<span class="ruby-value">1</span>].<span class="ruby-identifier">to_f</span>) <span class="ruby-operator">/</span> <span class="ruby-value">2.0</span>
845
- 42: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>
846
- 43: <span class="ruby-keyword kw">end</span></pre>
847
- </div>
848
-
849
- </div>
850
-
851
-
852
-
853
-
854
- </div>
855
-
856
-
857
- <div id="name-distance-to-method" class="method-detail ">
858
- <a name="method-i-name_distance_to"></a>
859
-
860
- <div class="method-heading">
861
-
862
- <span class="method-name">name_distance_to</span><span
863
- class="method-args">(other)</span>
864
- <span class="method-click-advice">click to toggle source</span>
865
-
866
- </div>
867
-
868
- <div class="method-description">
869
-
870
-
871
-
872
-
873
-
874
- <div class="method-source-code"
875
- id="name-distance-to-source">
876
- <pre>
877
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 90</span>
878
- 90: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">name_distance_to</span>(<span class="ruby-identifier">other</span>)
879
- 91: <span class="ruby-constant">Levenshtein</span><span class="ruby-operator">::</span><span class="ruby-identifier">normalized_distance</span>(<span class="ruby-ivar">@name</span>, <span class="ruby-identifier">other</span>.<span class="ruby-identifier">name</span>)
880
- 92: <span class="ruby-keyword kw">end</span></pre>
881
- </div>
882
-
883
- </div>
884
-
885
-
886
-
887
-
888
- </div>
889
-
890
-
891
- <div id="rating-method" class="method-detail ">
892
- <a name="method-i-rating"></a>
893
-
894
- <div class="method-heading">
895
-
896
- <span class="method-name">rating</span><span
897
- class="method-args">()</span>
898
- <span class="method-click-advice">click to toggle source</span>
899
-
900
- </div>
901
-
902
- <div class="method-description">
903
-
904
-
905
-
906
-
907
-
908
- <div class="method-source-code"
909
- id="rating-source">
910
- <pre>
911
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 22</span>
912
- 22: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rating</span>
913
- 23: <span class="ruby-ivar">@ratings</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">:+</span>) <span class="ruby-operator">/</span> <span class="ruby-ivar">@ratings</span>.<span class="ruby-identifier">length</span>
914
- 24: <span class="ruby-keyword kw">end</span></pre>
915
- </div>
916
-
917
- </div>
918
-
919
-
920
-
921
-
922
- </div>
923
-
924
-
925
- <div id="to-s-method" class="method-detail ">
926
- <a name="method-i-to_s"></a>
927
-
928
- <div class="method-heading">
929
-
930
- <span class="method-name">to_s</span><span
931
- class="method-args">()</span>
932
- <span class="method-click-advice">click to toggle source</span>
933
-
934
- </div>
935
-
936
- <div class="method-description">
937
-
938
-
939
-
940
-
941
-
942
- <div class="method-source-code"
943
- id="to-s-source">
944
- <pre>
945
- <span class="ruby-comment cmt"># File lib/bizratr/business.rb, line 16</span>
946
- 16: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
947
- 17: <span class="ruby-identifier">attrs</span> = [<span class="ruby-value">:name</span>, <span class="ruby-value">:phone</span>, <span class="ruby-value">:address</span>, <span class="ruby-value">:state</span>, <span class="ruby-value">:country</span>, <span class="ruby-value">:zip</span>, <span class="ruby-value">:twitter</span>, <span class="ruby-value">:ids</span>, <span class="ruby-value">:checkins</span>, <span class="ruby-value">:users</span>, <span class="ruby-value">:likes</span>, <span class="ruby-value">:ratings</span>, <span class="ruby-value">:review_counts</span>, <span class="ruby-value">:coords</span>, <span class="ruby-value">:city</span>]
948
- 18: <span class="ruby-identifier">args</span> = <span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;#{k.to_s}=#{send(k)}&quot;</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;, &quot;</span>)
949
- 19: <span class="ruby-node">&quot;&lt;Business [#{args}]&gt;&quot;</span>
950
- 20: <span class="ruby-keyword kw">end</span></pre>
951
- </div>
952
-
953
- </div>
954
-
955
-
956
-
957
-
958
- </div>
959
-
960
-
961
- </div>
962
-
963
-
964
- </div>
965
-
966
-
967
- <div id="rdoc-debugging-section-dump" class="debugging-section">
968
-
969
- <p>Disabled; run with --debug to generate this.</p>
970
-
971
- </div>
972
-
973
- <div id="validator-badges">
974
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
975
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
976
- Rdoc Generator</a> 1.1.6</small>.</p>
977
- </div>
978
-
979
- </body>
980
- </html>
981
-