Module: ProductHunt::API::Users
- Included in:
- ProductHunt::API
- Defined in:
- lib/product_hunt/api/users.rb
Constant Summary collapse
- USERS_PATH =
"/users"
- CURRENT_USER_PATH =
"/me"
Instance Method Summary collapse
Instance Method Details
#current_user(options = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/product_hunt/api/users.rb', line 20 def current_user( = {}) process(CURRENT_USER_PATH, ) do |response| User.new(response["user"], self) end end |
#user(id, options = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/product_hunt/api/users.rb', line 14 def user(id, = {}) process(USERS_PATH + "/#{id}", ) do |response| User.new(response["user"], self) end end |
#users(options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/product_hunt/api/users.rb', line 8 def users( = {}) process(USERS_PATH, ) do |response| response["users"].map{ |user| User.new(user, self) } end end |