Class: KeytechKit::User
- Inherits:
-
Object
- Object
- KeytechKit::User
- Includes:
- HTTParty
- Defined in:
- lib/keytechKit/user.rb
Overview
The user Object This represents a keytech user.
Instance Attribute Summary collapse
-
#isActive ⇒ Object
Returns the value of attribute isActive.
-
#isAdmin ⇒ Object
Returns the value of attribute isAdmin.
-
#isSuperuser ⇒ Object
Returns the value of attribute isSuperuser.
-
#languageID ⇒ Object
Returns the value of attribute languageID.
-
#longName ⇒ Object
Returns the value of attribute longName.
-
#mail ⇒ Object
Returns the value of attribute mail.
-
#name ⇒ Object
Returns the value of attribute name.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
- #favorites ⇒ Object
-
#initialize(base_url, username, password) ⇒ User
constructor
A new instance of User.
-
#load(username) ⇒ Object
Returns a updated user object username = key of user.
- #queries(options = {}) ⇒ Object
Constructor Details
#initialize(base_url, username, password) ⇒ User
Returns a new instance of User.
20 21 22 23 |
# File 'lib/keytechKit/user.rb', line 20 def initialize(base_url, username, password) self.class.base_uri(base_url) @auth = { username: username, password: password } end |
Instance Attribute Details
#isActive ⇒ Object
Returns the value of attribute isActive.
12 13 14 |
# File 'lib/keytechKit/user.rb', line 12 def isActive @isActive end |
#isAdmin ⇒ Object
Returns the value of attribute isAdmin.
13 14 15 |
# File 'lib/keytechKit/user.rb', line 13 def isAdmin @isAdmin end |
#isSuperuser ⇒ Object
Returns the value of attribute isSuperuser.
14 15 16 |
# File 'lib/keytechKit/user.rb', line 14 def isSuperuser @isSuperuser end |
#languageID ⇒ Object
Returns the value of attribute languageID.
16 17 18 |
# File 'lib/keytechKit/user.rb', line 16 def languageID @languageID end |
#longName ⇒ Object
Returns the value of attribute longName.
17 18 19 |
# File 'lib/keytechKit/user.rb', line 17 def longName @longName end |
#mail ⇒ Object
Returns the value of attribute mail.
18 19 20 |
# File 'lib/keytechKit/user.rb', line 18 def mail @mail end |
#name ⇒ Object
Returns the value of attribute name.
15 16 17 |
# File 'lib/keytechKit/user.rb', line 15 def name @name end |
#response ⇒ Object
Returns the value of attribute response.
10 11 12 |
# File 'lib/keytechKit/user.rb', line 10 def response @response end |
Instance Method Details
#favorites ⇒ Object
44 45 46 |
# File 'lib/keytechKit/user.rb', line 44 def favorites load_target_links('favorites') end |
#load(username) ⇒ Object
Returns a updated user object username = key of user
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/keytechKit/user.rb', line 27 def load(username) = {} [:basic_auth] = @auth response = self.class.get("/user/#{username}", ) if response.success? self.response = response parse_response self else raise response.response end end |
#queries(options = {}) ⇒ Object
40 41 42 |
# File 'lib/keytechKit/user.rb', line 40 def queries( = {}) load_target_links('queries', ) end |