yelp-fusion 0.1.pre.beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rubocop.yml +1 -0
- data/.rubocop_todo.yml +210 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +8 -0
- data/LICENSE.txt +21 -0
- data/README.md +180 -0
- data/Rakefile +9 -0
- data/Test::vcr_casettes/business.yml +75 -0
- data/Test::vcr_casettes/match.yml +61 -0
- data/Test::vcr_casettes/phone.yml +65 -0
- data/Test::vcr_casettes/review.yml +72 -0
- data/Test::vcr_casettes/search.yml +263 -0
- data/Test::vcr_casettes/search_by_coordinates.yml +57 -0
- data/Test::vcr_casettes/transaction.yml +254 -0
- data/Test::vcr_casettes/transaction_by_coordinates.yml +56 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/yelp/fusion.rb +36 -0
- data/lib/yelp/fusion/client.rb +86 -0
- data/lib/yelp/fusion/configuration.rb +37 -0
- data/lib/yelp/fusion/endpoint/business.rb +70 -0
- data/lib/yelp/fusion/endpoint/match.rb +64 -0
- data/lib/yelp/fusion/endpoint/phone.rb +71 -0
- data/lib/yelp/fusion/endpoint/review.rb +72 -0
- data/lib/yelp/fusion/endpoint/search.rb +104 -0
- data/lib/yelp/fusion/endpoint/transaction.rb +97 -0
- data/lib/yelp/fusion/error.rb +105 -0
- data/lib/yelp/fusion/responses/base.rb +43 -0
- data/lib/yelp/fusion/responses/business.rb +36 -0
- data/lib/yelp/fusion/responses/match.rb +36 -0
- data/lib/yelp/fusion/responses/models/business.rb +48 -0
- data/lib/yelp/fusion/responses/models/categories.rb +34 -0
- data/lib/yelp/fusion/responses/models/center.rb +34 -0
- data/lib/yelp/fusion/responses/models/hours.rb +38 -0
- data/lib/yelp/fusion/responses/models/location.rb +36 -0
- data/lib/yelp/fusion/responses/models/openHours.rb +34 -0
- data/lib/yelp/fusion/responses/models/region.rb +38 -0
- data/lib/yelp/fusion/responses/models/reviews.rb +38 -0
- data/lib/yelp/fusion/responses/models/user.rb +36 -0
- data/lib/yelp/fusion/responses/phone.rb +36 -0
- data/lib/yelp/fusion/responses/review.rb +36 -0
- data/lib/yelp/fusion/responses/search.rb +38 -0
- data/lib/yelp/fusion/responses/transaction.rb +36 -0
- data/lib/yelp/fusion/version.rb +25 -0
- data/yelp-fusion.gemspec +44 -0
- metadata +192 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 80658442d93d963e007622927ab89a7ac491147478d4f2ad58ccffff7a44ab05
|
4
|
+
data.tar.gz: 9c25f9f8fa8d95c53868b23f94153b7c82826783a1890f236286265598a56859
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5dff4e7d3367dc7ae44bec1c92f8aaf64cc9d1490276b23b2b35dc6f98a3c89924ab4055530b43e6b58e11801cc0a680e78222ed4717a38fc8d4ab009a93bfaa
|
7
|
+
data.tar.gz: addaae0328ee2601ed443175d3f653bcb925ae1a74f0fb220990d8d0f29c2a62532fe7b04a7c5b389ad565d5cf9e9f2038babf7008d612230428a15375e2d8f9
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
inherit_from: .rubocop_todo.yml
|
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,210 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-06-20 16:01:59 -0400 using RuboCop version 0.57.2.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 2
|
10
|
+
# Cop supports --auto-correct.
|
11
|
+
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
|
12
|
+
# Include: **/*.gemspec
|
13
|
+
Gemspec/OrderedDependencies:
|
14
|
+
Exclude:
|
15
|
+
|
16
|
+
# Offense count: 1
|
17
|
+
# Cop supports --auto-correct.
|
18
|
+
Layout/CommentIndentation:
|
19
|
+
Exclude:
|
20
|
+
|
21
|
+
# Offense count: 2
|
22
|
+
# Cop supports --auto-correct.
|
23
|
+
# Configuration parameters: EnforcedStyle.
|
24
|
+
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
|
25
|
+
Layout/EmptyLinesAroundClassBody:
|
26
|
+
Exclude:
|
27
|
+
|
28
|
+
# Offense count: 1
|
29
|
+
# Cop supports --auto-correct.
|
30
|
+
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
|
31
|
+
Layout/ExtraSpacing:
|
32
|
+
Exclude:
|
33
|
+
|
34
|
+
# Offense count: 1
|
35
|
+
# Cop supports --auto-correct.
|
36
|
+
# Configuration parameters: Width, IgnoredPatterns.
|
37
|
+
Layout/IndentationWidth:
|
38
|
+
Exclude:
|
39
|
+
|
40
|
+
# Offense count: 1
|
41
|
+
# Cop supports --auto-correct.
|
42
|
+
Layout/LeadingCommentSpace:
|
43
|
+
Exclude:
|
44
|
+
|
45
|
+
# Offense count: 1
|
46
|
+
# Cop supports --auto-correct.
|
47
|
+
# Configuration parameters: EnforcedStyle, IndentationWidth.
|
48
|
+
# SupportedStyles: aligned, indented
|
49
|
+
Layout/MultilineOperationIndentation:
|
50
|
+
Exclude:
|
51
|
+
|
52
|
+
# Offense count: 2
|
53
|
+
# Cop supports --auto-correct.
|
54
|
+
Layout/SpaceAfterComma:
|
55
|
+
Exclude:
|
56
|
+
|
57
|
+
# Offense count: 4
|
58
|
+
# Cop supports --auto-correct.
|
59
|
+
# Configuration parameters: EnforcedStyle.
|
60
|
+
# SupportedStyles: space, no_space
|
61
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
62
|
+
Exclude:
|
63
|
+
|
64
|
+
# Offense count: 1
|
65
|
+
# Cop supports --auto-correct.
|
66
|
+
# Configuration parameters: AllowForAlignment.
|
67
|
+
Layout/SpaceAroundOperators:
|
68
|
+
Exclude:
|
69
|
+
|
70
|
+
# Offense count: 1
|
71
|
+
# Cop supports --auto-correct.
|
72
|
+
Layout/SpaceBeforeComma:
|
73
|
+
Exclude:
|
74
|
+
|
75
|
+
# Offense count: 1
|
76
|
+
# Cop supports --auto-correct.
|
77
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
|
78
|
+
# SupportedStyles: space, no_space
|
79
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
80
|
+
Layout/SpaceInsideBlockBraces:
|
81
|
+
Exclude:
|
82
|
+
|
83
|
+
# Offense count: 4
|
84
|
+
# Cop supports --auto-correct.
|
85
|
+
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
|
86
|
+
# SupportedStyles: space, no_space, compact
|
87
|
+
# SupportedStylesForEmptyBraces: space, no_space
|
88
|
+
Layout/SpaceInsideHashLiteralBraces:
|
89
|
+
Exclude:
|
90
|
+
|
91
|
+
# Offense count: 23
|
92
|
+
# Cop supports --auto-correct.
|
93
|
+
# Configuration parameters: EnforcedStyle.
|
94
|
+
# SupportedStyles: final_newline, final_blank_line
|
95
|
+
Layout/TrailingBlankLines:
|
96
|
+
Enabled: false
|
97
|
+
|
98
|
+
# Offense count: 8
|
99
|
+
# Cop supports --auto-correct.
|
100
|
+
# Configuration parameters: AllowInHeredoc.
|
101
|
+
Layout/TrailingWhitespace:
|
102
|
+
Exclude:
|
103
|
+
|
104
|
+
# Offense count: 1
|
105
|
+
Lint/InterpolationCheck:
|
106
|
+
Exclude:
|
107
|
+
|
108
|
+
# Offense count: 1
|
109
|
+
# Cop supports --auto-correct.
|
110
|
+
# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments.
|
111
|
+
Lint/UnusedBlockArgument:
|
112
|
+
Exclude:
|
113
|
+
|
114
|
+
# Offense count: 1
|
115
|
+
# Cop supports --auto-correct.
|
116
|
+
# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods.
|
117
|
+
Lint/UnusedMethodArgument:
|
118
|
+
Exclude:
|
119
|
+
|
120
|
+
# Offense count: 1
|
121
|
+
Lint/UselessAssignment:
|
122
|
+
Exclude:
|
123
|
+
|
124
|
+
# Offense count: 6
|
125
|
+
Metrics/AbcSize:
|
126
|
+
Max: 15
|
127
|
+
|
128
|
+
# Offense count: 1
|
129
|
+
# Configuration parameters: CountComments, ExcludedMethods.
|
130
|
+
Metrics/BlockLength:
|
131
|
+
Max: 50
|
132
|
+
|
133
|
+
# Offense count: 1
|
134
|
+
# Configuration parameters: CountComments.
|
135
|
+
Metrics/ClassLength:
|
136
|
+
Max: 200
|
137
|
+
|
138
|
+
# Offense count: 7
|
139
|
+
# Configuration parameters: CountComments.
|
140
|
+
Metrics/MethodLength:
|
141
|
+
Max: 40
|
142
|
+
|
143
|
+
# Offense count: 1
|
144
|
+
# Cop supports --auto-correct.
|
145
|
+
Performance/RangeInclude:
|
146
|
+
Exclude:
|
147
|
+
|
148
|
+
# Offense count: 1
|
149
|
+
# Cop supports --auto-correct.
|
150
|
+
# Configuration parameters: MaxKeyValuePairs.
|
151
|
+
Performance/RedundantMerge:
|
152
|
+
Exclude:
|
153
|
+
|
154
|
+
# Offense count: 1
|
155
|
+
# Cop supports --auto-correct.
|
156
|
+
# Configuration parameters: EnforcedStyle.
|
157
|
+
# SupportedStyles: braces, no_braces, context_dependent
|
158
|
+
Style/BracesAroundHashParameters:
|
159
|
+
Exclude:
|
160
|
+
|
161
|
+
# Offense count: 1
|
162
|
+
Style/ClassVars:
|
163
|
+
Exclude:
|
164
|
+
|
165
|
+
# Offense count: 21
|
166
|
+
Style/Documentation:
|
167
|
+
Enabled:
|
168
|
+
|
169
|
+
# Offense count: 1
|
170
|
+
# Cop supports --auto-correct.
|
171
|
+
Style/ExpandPathArguments:
|
172
|
+
Exclude:
|
173
|
+
|
174
|
+
# Offense count: 2
|
175
|
+
# Configuration parameters: MinBodyLength.
|
176
|
+
Style/GuardClause:
|
177
|
+
Exclude:
|
178
|
+
|
179
|
+
# Offense count: 1
|
180
|
+
# Cop supports --auto-correct.
|
181
|
+
# Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
|
182
|
+
# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
|
183
|
+
Style/HashSyntax:
|
184
|
+
Exclude:
|
185
|
+
|
186
|
+
# Offense count: 2
|
187
|
+
# Cop supports --auto-correct.
|
188
|
+
Style/IfUnlessModifier:
|
189
|
+
Exclude:
|
190
|
+
|
191
|
+
# Offense count: 1
|
192
|
+
# Cop supports --auto-correct.
|
193
|
+
Style/LineEndConcatenation:
|
194
|
+
Exclude:
|
195
|
+
|
196
|
+
# Offense count: 3
|
197
|
+
# Cop supports --auto-correct.
|
198
|
+
Style/MutableConstant:
|
199
|
+
Exclude:
|
200
|
+
|
201
|
+
# Offense count: 1
|
202
|
+
# Cop supports --auto-correct.
|
203
|
+
Style/RedundantParentheses:
|
204
|
+
Exclude:
|
205
|
+
|
206
|
+
# Offense count: 19
|
207
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
|
208
|
+
# URISchemes: http, https
|
209
|
+
Metrics/LineLength:
|
210
|
+
Max: 80
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at egrueter@jobcase.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2018 Jobcase, Inc
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
# Yelp::Fusion
|
2
|
+
|
3
|
+
This is a Ruby Gem for the Yelp API. It'll simplify the process of consuming data from the Yelp API for developers using Ruby. The library encompasses both Search and Business API functions.
|
4
|
+
|
5
|
+
This library is in Beta and should be used for testing purposes only.
|
6
|
+
|
7
|
+
Please remember to read and follow the [Terms of Use](https://www.yelp.com/developers/api_terms) and [display requirements](https://www.yelp.com/developers/display_requirements)before creating your applications.
|
8
|
+
|
9
|
+
|
10
|
+
## Installation
|
11
|
+
|
12
|
+
Add this line to your application's Gemfile:
|
13
|
+
|
14
|
+
```ruby
|
15
|
+
gem 'yelp-fusion', require: 'yelp-fusion'
|
16
|
+
```
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install yelp-fusion
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
### Basic Usage
|
29
|
+
|
30
|
+
The gem uses a client model to query against the API. You create and configure a client with your API keys and make requests through that.
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require 'yelp-fusion'
|
34
|
+
|
35
|
+
client = Yelp::Fusion::Client.new(YOUR_API_KEY)
|
36
|
+
```
|
37
|
+
|
38
|
+
Alternatively, you can also globally configure the client using a configure
|
39
|
+
block, and access a client singleton using `Yelp::Fusion.client`. If you intend to
|
40
|
+
use the gem with Rails, the client should be configured in an initializer.
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
require 'yelp-fusion'
|
44
|
+
|
45
|
+
configuration = Yelp.client.configure do |config|
|
46
|
+
config.api_key = YOUR_API_KEY
|
47
|
+
end
|
48
|
+
|
49
|
+
configuration.search('San Francisco', { term: 'food' })
|
50
|
+
```
|
51
|
+
After creating the client you're able to make requests to either the Search, Business, Phone, Review, Match, and Transaction API. Note: you must have an API key. If you need any keys sign up and get access from [http://www.yelp.com/developers](http://www.yelp.com/developers).
|
52
|
+
|
53
|
+
### [Search API](https://www.yelp.com/developers/documentation/v3/business_search)
|
54
|
+
|
55
|
+
Once you have a client you can use ``#search`` to make a request to the Search API.
|
56
|
+
|
57
|
+
```ruby
|
58
|
+
client.search('San Francisco')
|
59
|
+
```
|
60
|
+
|
61
|
+
You can also pass in general params and locale options to the method as hashes
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
params = { term: 'food',
|
65
|
+
limit: 3,
|
66
|
+
category_filter: 'discgolf'
|
67
|
+
}
|
68
|
+
|
69
|
+
locale = { lang: 'fr' }
|
70
|
+
|
71
|
+
client.search('San Francisco', params, locale)
|
72
|
+
```
|
73
|
+
Key names and options for params and locale match the documented names on the [Yelp Search API](https://www.yelp.com/developers/documentation/v3/business_search)
|
74
|
+
|
75
|
+
Additionally there is one more search methods for searching by [geographical coordinates](https://www.yelp.com/developers/documentation/v3/business_search):
|
76
|
+
|
77
|
+
```ruby
|
78
|
+
# coordinates
|
79
|
+
coordinates = { latitude: 37.7577, longitude: -122.4376 }
|
80
|
+
client.search_by_coordinates(coordinates, params)
|
81
|
+
```
|
82
|
+
|
83
|
+
### [Business API](https://www.yelp.com/developers/documentation/v3/business)
|
84
|
+
|
85
|
+
To use the Business API after you have a client you just need to call ``#business`` with a business id
|
86
|
+
|
87
|
+
```ruby
|
88
|
+
client.business('lJAGnYzku5zSaLnQ_T6_GQ')
|
89
|
+
```
|
90
|
+
|
91
|
+
### [Phone Search API](https://www.yelp.com/developers/documentation/v3/business_search_phone)
|
92
|
+
|
93
|
+
To use the Phone Search API after you have a client you just need to call ``#phone_search`` with a phone number and make sure you use the country code.
|
94
|
+
|
95
|
+
```ruby
|
96
|
+
client.phone_search('+15555555555')
|
97
|
+
```
|
98
|
+
|
99
|
+
### [Review Details API](https://www.yelp.com/developers/documentation/v3/business_reviews)
|
100
|
+
|
101
|
+
To find all of the reviews for a business, use ``#review`` with a business ID.
|
102
|
+
|
103
|
+
```ruby
|
104
|
+
client.review('lJAGnYzku5zSaLnQ_T6_GQ')
|
105
|
+
```
|
106
|
+
|
107
|
+
### [Transaction Details API](https://www.yelp.com/developers/documentation/v3/transaction_search)
|
108
|
+
|
109
|
+
To find all of the reviews for a business, use ``#transaction`` with ``'deliver'`` and a business ID.
|
110
|
+
|
111
|
+
```ruby
|
112
|
+
client.transaction_search('delivery', {location: 'San Francisco'})
|
113
|
+
```
|
114
|
+
|
115
|
+
### [Match Details API](https://www.yelp.com/developers/documentation/v3/business_match)
|
116
|
+
|
117
|
+
To find all of the reviews for a business, use ``#match`` with a business ID.
|
118
|
+
|
119
|
+
```ruby
|
120
|
+
client.match({name: 'swissbakers', address1: '168 Western Ave', city: 'allston', state: 'MA', country: 'US'})
|
121
|
+
```
|
122
|
+
|
123
|
+
## Responses
|
124
|
+
|
125
|
+
Responses from the API are all parsed and converted into Ruby objects. You're able to access information using dot-notation
|
126
|
+
|
127
|
+
```ruby
|
128
|
+
## search
|
129
|
+
response = client.search('San Francisco')
|
130
|
+
|
131
|
+
response.businesses
|
132
|
+
# [<Business 1>, <Business 2>, ...]
|
133
|
+
|
134
|
+
response.businesses[0].name
|
135
|
+
# "Kim Makoi, DC"
|
136
|
+
|
137
|
+
response.businesses[0].rating
|
138
|
+
# 5.0
|
139
|
+
|
140
|
+
|
141
|
+
## business
|
142
|
+
response = client.business('lJAGnYzku5zSaLnQ_T6_GQ')
|
143
|
+
|
144
|
+
response.business.name
|
145
|
+
# Yelp
|
146
|
+
|
147
|
+
response.business.categories
|
148
|
+
# [["Local Flavor", "localflavor"], ["Mass Media", "massmedia"]]
|
149
|
+
```
|
150
|
+
|
151
|
+
For specific response values check out the docs for the [Search API](http://www.yelp.com/developers/documentation/v2/search_api#rValue), the [Business API](http://www.yelp.com/developers/documentation/v2/business#rValue), the [Match API](https://www.yelp.com/developers/documentation/v3/business_match), the [Phone API](https://www.yelp.com/developers/documentation/v3/business_search_phone), the [Review API](https://www.yelp.com/developers/documentation/v3/business_reviews), and the [Transaction API](https://www.yelp.com/developers/documentation/v3/transaction_search)
|
152
|
+
|
153
|
+
## Development
|
154
|
+
|
155
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
156
|
+
|
157
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
158
|
+
|
159
|
+
## Contributing
|
160
|
+
|
161
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/yelp-fusion. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
162
|
+
|
163
|
+
1. Fork it ( http://github.com/yelp/yelp-ruby/fork )
|
164
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
165
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
166
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
167
|
+
5. Create new Pull Request
|
168
|
+
|
169
|
+
Our minitest test suite expects environment variables to be populated with your Yelp API Access Tokens.
|
170
|
+
|
171
|
+
You can generate and find your Access Tokens at [https://www.yelp.com/developers/manage_api_keys](https://www.yelp.com/developers/v3/manage_app).
|
172
|
+
|
173
|
+
## License
|
174
|
+
|
175
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT), Copyright (c) 2018 Jobcase, Inc
|
176
|
+
|
177
|
+
|
178
|
+
## Code of Conduct
|
179
|
+
|
180
|
+
Everyone interacting in the Yelp::Fusion project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/yelp-fusion/blob/master/CODE_OF_CONDUCT.md).
|