Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extra attributes to the prediction results #100

Merged
merged 1 commit into from Jul 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,11 @@
## 0.34.2

- Add the `matched_substrings` attribute to the Prediction results (for autocomplete results)
- Add the `structured_formatting` attribute to the Prediction results (for autocomplete results)

## 0.34.1

- Remove new argument that was accidently added to the Review class
- Remove new argument that was accidentally added to the Review class

## 0.34.0

Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
google_places (0.34.1)
google_places (0.34.2)
httparty (>= 0.13.1, < 0.14.1)

GEM
Expand Down Expand Up @@ -46,4 +46,4 @@ DEPENDENCIES
webmock (~> 1.18)

BUNDLED WITH
1.14.4
1.14.6
2 changes: 1 addition & 1 deletion google_places.gemspec
Expand Up @@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)

Gem::Specification.new do |s|
s.name = 'google_places'
s.version = '0.34.1'
s.version = '0.34.2'
s.platform = Gem::Platform::RUBY
s.authors = ['Marcel de Graaf']
s.email = ['mail@marceldegraaf.net']
Expand Down
6 changes: 5 additions & 1 deletion lib/google_places/prediction.rb
Expand Up @@ -5,14 +5,18 @@ class Prediction
:description,
:place_id,
:terms,
:types
:types,
:matched_substrings,
:structured_formatting
)

def initialize(json_result_object)
@description = json_result_object['description']
@place_id = json_result_object['place_id']
@terms = json_result_object['terms']
@types = json_result_object['types']
@matched_substrings = json_result_object['matched_substrings']
@structured_formatting = json_result_object['structured_formatting']
end

# Query for Predictions (optionally at the provided location)
Expand Down