Class: Cassiopeia::User
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Cassiopeia::User
- Defined in:
- lib/cassiopeia/user.rb
Instance Method Summary collapse
- #has_role?(role) ⇒ Boolean
-
#initialize(hash) ⇒ User
constructor
A new instance of User.
- #to_json(o) ⇒ Object
Constructor Details
#initialize(hash) ⇒ User
Returns a new instance of User.
9 10 11 |
# File 'lib/cassiopeia/user.rb', line 9 def initialize(hash) super(hash) end |
Instance Method Details
#has_role?(role) ⇒ Boolean
13 14 15 |
# File 'lib/cassiopeia/user.rb', line 13 def has_role?(role) roles && roles.respond_to?(:include?) && roles.include?(role.to_s) end |
#to_json(o) ⇒ Object
5 6 7 |
# File 'lib/cassiopeia/user.rb', line 5 def to_json(o) table.to_json(o) end |