Class: Rubirai::GroupUser

Inherits:
User
  • Object
show all
Defined in:
lib/rubirai/objects/user.rb

Instance Attribute Summary collapse

Attributes inherited from User

#bot, #id, #name, #remark

Instance Method Summary collapse

Constructor Details

#initialize(hash, bot = nil) ⇒ GroupUser

Returns a new instance of GroupUser.

Raises:



22
23
24
25
26
27
28
# File 'lib/rubirai/objects/user.rb', line 22

def initialize(hash, bot = nil)
  raise(RubiraiError, 'not a group user') unless hash.key? 'group'
  super(hash, bot)
  @member_name = hash['memberName']
  @permission = hash['permission']
  @group = Group.new(hash['group'], bot)
end

Instance Attribute Details

#groupObject (readonly)

Returns the value of attribute group.



20
21
22
# File 'lib/rubirai/objects/user.rb', line 20

def group
  @group
end

#member_nameObject (readonly)

Returns the value of attribute member_name.



20
21
22
# File 'lib/rubirai/objects/user.rb', line 20

def member_name
  @member_name
end

#permissionObject (readonly)

Returns the value of attribute permission.



20
21
22
# File 'lib/rubirai/objects/user.rb', line 20

def permission
  @permission
end