Class: Rubirai::User

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

Direct Known Subclasses

GroupUser

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, bot = nil) ⇒ User

Returns a new instance of User.



10
11
12
13
14
15
16
# File 'lib/rubirai/objects/user.rb', line 10

def initialize(hash, bot = nil)
  hash = hash.stringify_keys
  @bot = bot
  @id = hash['id']
  @name = hash['name'] || hash['nickname']
  @remark = hash['remark']
end

Instance Attribute Details

#botObject (readonly)

Returns the value of attribute bot.



8
9
10
# File 'lib/rubirai/objects/user.rb', line 8

def bot
  @bot
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/rubirai/objects/user.rb', line 8

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/rubirai/objects/user.rb', line 8

def name
  @name
end

#remarkObject (readonly)

Returns the value of attribute remark.



8
9
10
# File 'lib/rubirai/objects/user.rb', line 8

def remark
  @remark
end