1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
class User |
1✔ |
4 |
ADMIN_ROLE = 'admin' |
1✔ |
5 |
|
|
6 |
attr_accessor :id, :role |
1✔ |
7 |
|
|
8 |
def initialize(id:, role:) |
1✔ |
9 |
self.id = id
|
7✔ |
10 |
self.role = role
|
7✔ |
11 |
end
|
|
12 |
|
|
13 |
def admin? |
1✔ |
14 |
role == ADMIN_ROLE
|
7✔ |
15 |
end
|
|
16 |
end
|