Class: Multiapi::Resources::User

Inherits:
Object
  • Object
show all
Defined in:
lib/multiapi/resources/user.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ User

Returns a new instance of User.



4
5
6
# File 'lib/multiapi/resources/user.rb', line 4

def initialize(client)
  @client = client
end

Instance Method Details

#create(attributes) ⇒ Object



12
13
14
# File 'lib/multiapi/resources/user.rb', line 12

def create(attributes)
  @client.post('/users', attributes)
end

#delete(id) ⇒ Object



24
25
26
# File 'lib/multiapi/resources/user.rb', line 24

def delete(id)
  @client.delete("/users/#{id}")
end

#find(id) ⇒ Object



16
17
18
# File 'lib/multiapi/resources/user.rb', line 16

def find(id)
  @client.get("/users/#{id}")
end

#list(page: 1, per_page: 20) ⇒ Object



8
9
10
# File 'lib/multiapi/resources/user.rb', line 8

def list(page: 1, per_page: 20)
  @client.get('/users', page: page, per_page: per_page)
end

#update(id, attributes) ⇒ Object



20
21
22
# File 'lib/multiapi/resources/user.rb', line 20

def update(id, attributes)
  @client.put("/users/#{id}", attributes)
end