Class: Allegro::WebApi::Client
- Inherits:
-
Object
- Object
- Allegro::WebApi::Client
- Defined in:
- lib/allegro/webapi/client.rb
Constant Summary collapse
- END_POINT =
'https://webapi.allegro.pl/service.php?wsdl'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#local_version ⇒ Object
Returns the value of attribute local_version.
-
#password ⇒ Object
Returns the value of attribute password.
-
#session_handle ⇒ Object
readonly
Returns the value of attribute session_handle.
-
#user_login ⇒ Object
Returns the value of attribute user_login.
-
#webapi_key ⇒ Object
Returns the value of attribute webapi_key.
Instance Method Summary collapse
- #call(operation_name, locals = {}) ⇒ Object
-
#initialize {|_self| ... } ⇒ Client
constructor
A new instance of Client.
- #login ⇒ Object
- #set_session_handle(login_response) ⇒ Object
Constructor Details
#initialize {|_self| ... } ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/allegro/webapi/client.rb', line 9 def initialize yield self end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
7 8 9 |
# File 'lib/allegro/webapi/client.rb', line 7 def client @client end |
#country_code ⇒ Object
Returns the value of attribute country_code.
6 7 8 |
# File 'lib/allegro/webapi/client.rb', line 6 def country_code @country_code end |
#local_version ⇒ Object
Returns the value of attribute local_version.
6 7 8 |
# File 'lib/allegro/webapi/client.rb', line 6 def local_version @local_version end |
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/allegro/webapi/client.rb', line 7 def password @password end |
#session_handle ⇒ Object (readonly)
Returns the value of attribute session_handle.
7 8 9 |
# File 'lib/allegro/webapi/client.rb', line 7 def session_handle @session_handle end |
#user_login ⇒ Object
Returns the value of attribute user_login.
6 7 8 |
# File 'lib/allegro/webapi/client.rb', line 6 def user_login @user_login end |
#webapi_key ⇒ Object
Returns the value of attribute webapi_key.
6 7 8 |
# File 'lib/allegro/webapi/client.rb', line 6 def webapi_key @webapi_key end |
Instance Method Details
#call(operation_name, locals = {}) ⇒ Object
19 20 21 |
# File 'lib/allegro/webapi/client.rb', line 19 def call(operation_name, locals= {}) client.call(operation_name, locals) end |
#login ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/allegro/webapi/client.rb', line 23 def login start_client = {user_login: user_login, user_hash_password: password, country_code: country_code, webapi_key: webapi_key, local_version: local_version} response = client.call(:do_login_enc, message: ) set_session_handle(response) self end |
#set_session_handle(login_response) ⇒ Object
31 32 33 |
# File 'lib/allegro/webapi/client.rb', line 31 def set_session_handle(login_response) @session_handle = login_response.body[:do_login_enc_response][:session_handle_part] end |