Skip to content

Commit

Permalink
Merge pull request #100 from qpowell/prediction-structured-formatting
Browse files Browse the repository at this point in the history
Add extra attributes to the prediction results
  • Loading branch information
edwinwills committed Jul 13, 2017
2 parents 086e21d + 30f194a commit f5709ae
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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

0 comments on commit f5709ae

Please sign in to comment.