Module: Flattr::Client::Users
- Included in:
- Flattr::Client
- Defined in:
- lib/flattr/client/users.rb
Instance Method Summary collapse
-
#user(username = nil) ⇒ Object
Public: Get a user or the one currently authenticated.
-
#user_flattrs(username = nil, args = {}) ⇒ Object
Public: Get a users flattrs.
-
#user_things(username = nil, args = {}) ⇒ Object
Public: Get a users things.
Instance Method Details
#user(username = nil) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/flattr/client/users.rb', line 19 def user(username=nil) if username.nil? user = get("/rest/v2/user") else user = get("/rest/v2/users/#{username}") end Flattr::User.new(user) end |
#user_flattrs(username = nil, args = {}) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/flattr/client/users.rb', line 59 def user_flattrs(username=nil, args={}) user = username || self.current_user.username get("/rest/v2/users/#{user}/flattrs").map do |flattr| flattr end end |