Class: Zanders::User
- Inherits:
-
SoapClient
- Object
- Base
- SoapClient
- Zanders::User
- Defined in:
- lib/zanders/user.rb
Constant Summary
Constants inherited from SoapClient
Instance Attribute Summary collapse
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #authenticated? ⇒ Boolean
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
Methods inherited from Base
Constructor Details
#initialize(options = {}) ⇒ User
Returns a new instance of User.
6 7 8 9 10 11 |
# File 'lib/zanders/user.rb', line 6 def initialize( = {}) requires!(, :username, :password) @username = [:username] @password = [:password] end |
Instance Attribute Details
#password ⇒ Object (readonly)
Returns the value of attribute password.
4 5 6 |
# File 'lib/zanders/user.rb', line 4 def password @password end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
4 5 6 |
# File 'lib/zanders/user.rb', line 4 def username @username end |
Instance Method Details
#authenticated? ⇒ Boolean
13 14 15 16 17 18 |
# File 'lib/zanders/user.rb', line 13 def authenticated? response = soap_client(ITEM_API_URL).call(:login_check, message: build_request_data) response = response.body[:login_check_response][:return][:item] response.first[:value] == "0" end |