Class: GooglePlaces::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/google_places/client.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Client) initialize(api_key, options = {})



6
7
8
9
# File 'lib/google_places/client.rb', line 6

def initialize(api_key, options = {})
  @api_key = api_key
  @options = options
end

Instance Attribute Details

- (Object) api_key (readonly)

Returns the value of attribute api_key



3
4
5
# File 'lib/google_places/client.rb', line 3

def api_key
  @api_key
end

- (Object) options (readonly)

Returns the value of attribute options



4
5
6
# File 'lib/google_places/client.rb', line 4

def options
  @options
end

Instance Method Details

- (Object) spot(reference, options = {})



15
16
17
# File 'lib/google_places/client.rb', line 15

def spot(reference, options = {})
  Spot.find(reference, @api_key, @options.merge(options))
end

- (Object) spots(lat, lng, options = {})



11
12
13
# File 'lib/google_places/client.rb', line 11

def spots(lat, lng, options = {})
  Spot.list(lat, lng, @api_key, @options.merge(options))
end