Class: Devbootcamp::User
- Inherits:
-
Model
- Object
- Model
- Devbootcamp::User
show all
- Defined in:
- lib/devbootcamp/user.rb
Instance Attribute Summary
Attributes inherited from Model
#attributes
Class Method Summary
collapse
Methods inherited from Model
#as_json, attributes, #initialize, #serializable_hash
Class Method Details
.find(user_id) ⇒ Object
5
6
7
8
|
# File 'lib/devbootcamp/user.rb', line 5
def self.find(user_id)
raise ArgumentError, "user_id cannot be blank" if user_id.blank?
new Devbootcamp::Auth.get("/users/#{user_id}")
end
|
.me ⇒ Object
10
11
12
|
# File 'lib/devbootcamp/user.rb', line 10
def self.me
new Devbootcamp::Auth.get('/me')
end
|
.staff ⇒ Object
14
15
16
|
# File 'lib/devbootcamp/user.rb', line 14
def self.staff
Devbootcamp::Auth.get('/staff', cache_for: 1.hour).map(&method(:new))
end
|