Class: Tiltify::UsersResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/tiltify/resources/users.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Tiltify::Resource

Instance Method Details

#campaigns(user_id:) ⇒ Object



12
13
14
15
# File 'lib/tiltify/resources/users.rb', line 12

def campaigns(user_id:)
  response = get_request("users/#{user_id}/campaigns")
  Collection.from_response(response, type: Campaign)
end

#meObject



4
5
6
# File 'lib/tiltify/resources/users.rb', line 4

def me
  User.new get_request("user").body.dig("data")
end

#retrieve(user_id:) ⇒ Object



8
9
10
# File 'lib/tiltify/resources/users.rb', line 8

def retrieve(user_id:)
  User.new get_request("users/#{user_id}").body.dig("data")
end

#teams(user_id:) ⇒ Object



17
18
19
20
# File 'lib/tiltify/resources/users.rb', line 17

def teams(user_id:)
  response = get_request("users/#{user_id}/teams")
  Collection.from_response(response, type: Team)
end