Class: Hyperpublic::Places

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/hyperpublic/places.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#photos, #search_neighborhoods, #search_tags

Constructor Details

#initialize(client) ⇒ Places

Returns a new instance of Places.



8
9
10
# File 'lib/hyperpublic/places.rb', line 8

def initialize(client)
  @client = client
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



6
7
8
# File 'lib/hyperpublic/places.rb', line 6

def client
  @client
end

Instance Method Details

#create(options = {}) ⇒ Object



22
23
24
# File 'lib/hyperpublic/places.rb', line 22

def create(options={})
  perform_post("/places", :body => options)
end

#find(params) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/hyperpublic/places.rb', line 12

def find(params)
  if params.is_a? String
    perform_get("/places/#{params}")
  else
    q = Addressable::URI.new
    q.query_values = stringify(params)
    perform_get("/places?#{q.query}")
  end
end