Class: Wikidotrb::Module::User
- Inherits:
-
AbstractUser
- Object
- AbstractUser
- Wikidotrb::Module::User
- Defined in:
- lib/wikidotrb/module/user.rb
Overview
Regular user object
Instance Attribute Summary collapse
-
#avatar_url
Returns the value of attribute avatar_url.
-
#client
Returns the value of attribute client.
-
#id
Returns the value of attribute id.
-
#ip
Returns the value of attribute ip.
-
#name
Returns the value of attribute name.
-
#unix_name
Returns the value of attribute unix_name.
Class Method Summary collapse
-
.from_name(client, name, raise_when_not_found = false) ⇒ User
Get a user object from a username.
Instance Method Summary collapse
-
#initialize(client:, id: nil, name: nil, unix_name: nil, avatar_url: nil) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(client:, id: nil, name: nil, unix_name: nil, avatar_url: nil) ⇒ User
Returns a new instance of User.
77 78 79 |
# File 'lib/wikidotrb/module/user.rb', line 77 def initialize(client:, id: nil, name: nil, unix_name: nil, avatar_url: nil) super end |
Instance Attribute Details
#avatar_url
Returns the value of attribute avatar_url.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def avatar_url @avatar_url end |
#client
Returns the value of attribute client.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def client @client end |
#id
Returns the value of attribute id.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def id @id end |
#ip
Returns the value of attribute ip.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def ip @ip end |
#name
Returns the value of attribute name.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def name @name end |
#unix_name
Returns the value of attribute unix_name.
75 76 77 |
# File 'lib/wikidotrb/module/user.rb', line 75 def unix_name @unix_name end |
Class Method Details
.from_name(client, name, raise_when_not_found = false) ⇒ User
Get a user object from a username
86 87 88 |
# File 'lib/wikidotrb/module/user.rb', line 86 def self.from_name(client, name, raise_when_not_found = false) UserCollection.from_names(client, [name], raise_when_not_found).first end |