Class: Rubirai::User
- Inherits:
-
Object
- Object
- Rubirai::User
- Defined in:
- lib/rubirai/objects/user.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#bot ⇒ Object
readonly
Returns the value of attribute bot.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#remark ⇒ Object
readonly
Returns the value of attribute remark.
Instance Method Summary collapse
-
#initialize(hash, bot = nil) ⇒ User
constructor
A new instance of User.
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
#bot ⇒ Object (readonly)
Returns the value of attribute bot.
8 9 10 |
# File 'lib/rubirai/objects/user.rb', line 8 def bot @bot end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/rubirai/objects/user.rb', line 8 def id @id end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/rubirai/objects/user.rb', line 8 def name @name end |
#remark ⇒ Object (readonly)
Returns the value of attribute remark.
8 9 10 |
# File 'lib/rubirai/objects/user.rb', line 8 def remark @remark end |