Class: ChatX::User
- Inherits:
-
Object
- Object
- ChatX::User
- Defined in:
- lib/chatx/models/user.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#in_rooms ⇒ Object
readonly
Returns the value of attribute in_rooms.
-
#owns_rooms ⇒ Object
readonly
Returns the value of attribute owns_rooms.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(server, **opts) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(server, **opts) ⇒ User
Returns a new instance of User.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/chatx/models/user.rb', line 7 def initialize(server, **opts) if opts.values_at(:user_id).any?(&:nil?) raise ArgumentError, 'Got nil for an expected user property' end @server = server @id = opts[:user_id] end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def id @id end |
#in_rooms ⇒ Object (readonly)
Returns the value of attribute in_rooms.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def in_rooms @in_rooms end |
#owns_rooms ⇒ Object (readonly)
Returns the value of attribute owns_rooms.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def owns_rooms @owns_rooms end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def server @server end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/chatx/models/user.rb', line 5 def username @username end |