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

#initialize(api_key, options = {}) ⇒ Client

Returns a new instance of Client



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

#api_keyObject (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

#optionsObject (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

#spot(reference, options = {}) ⇒ Object



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

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

#spots(lat, lng, options = {}) ⇒ Object



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