Class: Cassiopeia::User

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/cassiopeia/user.rb

Instance Method Summary collapse

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

Returns:

  • (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