Class: Hyperpublic::People
- Extended by:
- Forwardable
- Defined in:
- lib/hyperpublic/people.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #create(options = {}) ⇒ Object
-
#find(params) ⇒ Object
param can be id => [1, 2, 3], => [tag1, tags], or => {:lat=>35,:lon=>-70} etc.
-
#initialize(client) ⇒ People
constructor
A new instance of People.
Methods inherited from Base
#photos, #search_neighborhoods, #search_tags
Constructor Details
#initialize(client) ⇒ People
Returns a new instance of People.
8 9 10 |
# File 'lib/hyperpublic/people.rb', line 8 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
6 7 8 |
# File 'lib/hyperpublic/people.rb', line 6 def client @client end |
Instance Method Details
#create(options = {}) ⇒ Object
28 29 30 |
# File 'lib/hyperpublic/people.rb', line 28 def create(={}) perform_post("/people", :body => ) end |
#find(params) ⇒ Object
param can be
id
{:ids => [1, 2, 3]},
{:tags => [tag1, ]}, or
{:location => {:lat=>35,:lon=>-70}}
etc
18 19 20 21 22 23 24 25 26 |
# File 'lib/hyperpublic/people.rb', line 18 def find(params) if params.is_a? String perform_get("/people/#{params}") else q = Addressable::URI.new q.query_values = stringify(params) perform_get("/people?#{q.query}") end end |