google-api-customization 0.0.1 → 0.0.2

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODkxM2MzMjkzMzBlODg1MTg0OTVkMjRlNDY3Yjg1ZWI1YmFhMDhkZg==
4
+ NGE4NmNiMzU1NjM4MmM3OWFhOWFjNjhhNWQ2NzczNTY2NWQxZGI5Ng==
5
5
  data.tar.gz: !binary |-
6
- NGNmMjAxMWJjYzE0NzU4MTc0MmMyYzYxMDVjZmQzNDMwZTFhNjNjZA==
6
+ NjUxZWY3NTEwYTcyNzQyODhiZGUyZDQyNjNmOTFjOTU0Yjg5NDJiYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjgwYjI0YTUzYjRmYTFjZTRlOTViYzk0OTgzNWUwN2RhMGUyYjkzY2Y1ZWRj
10
- OTRlM2NkMmY5MWFhZGJkYTE1OTM0N2U0MjRkMDc5ODM4ZWUxMjk2MTc1NjBj
11
- NjExODAxZmUzOTIzNjk5ZDMyODU2MTc2M2NlZTNmODg2MzI2MGQ=
9
+ YTdhNTBhY2Q2ZDFjMjZiZGUxOTQxODJiOTEwMGY4MDJhN2MwNWU4NTA1NmZk
10
+ YTQxY2FiOTVkMjkyNTI2NzdjZTcxMGMyZWVmZjJkMjllYjI3NzQyYmQ4MmM2
11
+ ZTYwMWE4Y2NjNTE3YzhmNWQ2ZmQxNmVjMzc1ZDc3Y2M4OGFhNmM=
12
12
  data.tar.gz: !binary |-
13
- ZjljOGYwODRlNDhkYzQzMTE5NGU5MWU5M2NiOWVlNGI1ZjYwOGVjYjUxOTQy
14
- MmI1YjQyMjI2Y2Q5OWIyOWVhY2M1MTU3ZDkwY2Q1NTRiNWM2NTI4ODZiZTIy
15
- YTBkYWMwODMzYmM3ZGEyMzk2NWM2YTM0YTM5OGJlN2ZiYWRhMDk=
13
+ NzlmOWI0YTVjNjk4MjQ3NjY5YzU3NDgxOGQ1OWMxMGVkNGIxYmRiZTJkMGFl
14
+ NmI3N2VjMmM4ODNlNGMyYjY5ZmMxMThlZDBjM2UzNDk4YjM2ZWEwNmExZDM4
15
+ YmI3YzNhOTRiOTRhNDhjNWRjOWM3OGNmMjZmNTk0MDhiZjVmOWE=
@@ -0,0 +1,21 @@
1
+ module GoogleApiCustomization
2
+
3
+ class ApiKey
4
+
5
+ attr_reader :api_key
6
+
7
+ attr_reader :options
8
+ attr_reader :sensor
9
+
10
+ def initialize(api_key = @api_key, sensor = false, options = {})
11
+ api_key ? @api_key = api_key : @api_key = GoogleApiCustomization.api_key
12
+ @sensor = sensor
13
+ @options = options
14
+ end
15
+
16
+ def place_detail(place_id, options = {})
17
+ Place.find(place_id, @api_key, @sensor, @options.merge(options))
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,44 @@
1
+ module GoogleApiCustomization
2
+ class Photo
3
+ attr_accessor :width, :height, :photo_reference, :html_attributions
4
+
5
+ def initialize(width, height, photo_reference, html_attributions, api_key, sensor)
6
+ @width = width
7
+ @height = height
8
+ @photo_reference = photo_reference
9
+ @html_attributions = html_attributions
10
+ @api_key = api_key
11
+ @sensor = sensor
12
+ end
13
+
14
+ # Search for a Photo's url with its reference key
15
+ #
16
+ # @return [URL]
17
+ # @param [String] api_key the provided api key
18
+ # @param [Boolean] sensor
19
+ # Indicates whether or not the Place request came from a device using a location sensor (e.g. a GPS)
20
+ # to determine the location sent in this request.
21
+ # <b>Note that this is a mandatory parameter</b>
22
+ # @param [Hash] options
23
+ # @option options [Hash] :retry_options ({})
24
+ # A Hash containing parameters for search retries
25
+ # @option options [Object] :retry_options[:status] ([])
26
+ # @option options [Integer] :retry_options[:max] (0) the maximum retries
27
+ # @option options [Integer] :retry_options[:delay] (5) the delay between each retry in seconds
28
+ def fetch_url(maxwidth, options = {})
29
+ language = options.delete(:language)
30
+ retry_options = options.delete(:retry_options) || {}
31
+
32
+ unless @fetched_url
33
+ @fetched_url = Request.photo_url(
34
+ :maxwidth => maxwidth,
35
+ :photoreference => @photo_reference,
36
+ :sensor => @sensor,
37
+ :key => @api_key,
38
+ :retry_options => retry_options
39
+ )
40
+ end
41
+ @fetched_url
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,14 @@
1
+ module GoogleApiCustomization
2
+ class Review
3
+ attr_accessor :rating, :type, :author_name, :author_url, :text, :time
4
+
5
+ def initialize(rating, type, author_name, author_url, text, time)
6
+ @rating = rating
7
+ @type = type
8
+ @author_name = author_name
9
+ @author_url = author_url
10
+ @text = text
11
+ @time = time
12
+ end
13
+ end
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api-customization
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abhishek Sharma
@@ -17,8 +17,11 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/google_api_customization.rb
20
+ - lib/google_api_customization/api_key.rb
21
+ - lib/google_api_customization/photo.rb
20
22
  - lib/google_api_customization/place.rb
21
23
  - lib/google_api_customization/request.rb
24
+ - lib/google_api_customization/review.rb
22
25
  homepage: http://rubygems.org/gems/google_api_customization
23
26
  licenses:
24
27
  - NONE