Class: Wikidotrb::Module::ClientUserMethods
- Inherits:
-
Object
- Object
- Wikidotrb::Module::ClientUserMethods
- Defined in:
- lib/wikidotrb/module/client.rb
Instance Attribute Summary collapse
-
#client
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#get(name, raise_when_not_found: false) ⇒ User
Get a user object from a username.
-
#get_bulk(names, raise_when_not_found: false) ⇒ Array<User>
Get user objects from a list of usernames.
-
#initialize(client) ⇒ ClientUserMethods
constructor
A new instance of ClientUserMethods.
Constructor Details
#initialize(client) ⇒ ClientUserMethods
Returns a new instance of ClientUserMethods.
16 17 18 |
# File 'lib/wikidotrb/module/client.rb', line 16 def initialize(client) @client = client end |
Instance Attribute Details
#client (readonly)
Returns the value of attribute client.
14 15 16 |
# File 'lib/wikidotrb/module/client.rb', line 14 def client @client end |
Instance Method Details
#get(name, raise_when_not_found: false) ⇒ User
Get a user object from a username
24 25 26 |
# File 'lib/wikidotrb/module/client.rb', line 24 def get(name, raise_when_not_found: false) Wikidotrb::Module::User.from_name(@client, name, raise_when_not_found) end |
#get_bulk(names, raise_when_not_found: false) ⇒ Array<User>
Get user objects from a list of usernames
32 33 34 |
# File 'lib/wikidotrb/module/client.rb', line 32 def get_bulk(names, raise_when_not_found: false) Wikidotrb::Module::UserCollection.from_names(@client, names, raise_when_not_found) end |