Class: Applicaster::User
- Inherits:
-
Object
- Object
- Applicaster::User
- Defined in:
- lib/applicaster/user.rb
Instance Attribute Summary collapse
-
#user_json ⇒ Object
Returns the value of attribute user_json.
Instance Method Summary collapse
- #admin ⇒ Object
- #admin? ⇒ Boolean
- #email ⇒ Object
- #global_roles ⇒ Object
- #id ⇒ Object
-
#initialize(user_json) ⇒ User
constructor
A new instance of User.
- #name ⇒ Object
- #permissions ⇒ Object
Constructor Details
#initialize(user_json) ⇒ User
Returns a new instance of User.
5 6 7 |
# File 'lib/applicaster/user.rb', line 5 def initialize(user_json) @user_json = user_json.symbolize_keys end |
Instance Attribute Details
#user_json ⇒ Object
Returns the value of attribute user_json.
3 4 5 |
# File 'lib/applicaster/user.rb', line 3 def user_json @user_json end |
Instance Method Details
#admin ⇒ Object
29 30 31 |
# File 'lib/applicaster/user.rb', line 29 def admin user_json[:admin] end |
#admin? ⇒ Boolean
33 34 35 |
# File 'lib/applicaster/user.rb', line 33 def admin? !!admin end |
#email ⇒ Object
17 18 19 |
# File 'lib/applicaster/user.rb', line 17 def email user_json[:email] end |
#global_roles ⇒ Object
21 22 23 |
# File 'lib/applicaster/user.rb', line 21 def global_roles user_json[:global_roles] end |
#id ⇒ Object
9 10 11 |
# File 'lib/applicaster/user.rb', line 9 def id user_json[:id] end |
#name ⇒ Object
13 14 15 |
# File 'lib/applicaster/user.rb', line 13 def name user_json[:name] end |
#permissions ⇒ Object
25 26 27 |
# File 'lib/applicaster/user.rb', line 25 def user_json[:permissions] end |