Class: Zm::Client::SoapContext
- Inherits:
-
Object
- Object
- Zm::Client::SoapContext
- Defined in:
- lib/zm/client/soap_request/soap_context.rb
Instance Method Summary collapse
- #account(by, value) ⇒ Object
-
#initialize ⇒ SoapContext
constructor
attr_reader :token, :user_agent, :target_server.
- #target_server(str) ⇒ Object
- #to_hash ⇒ Object
- #token(str) ⇒ Object
- #user_agent(str) ⇒ Object
Constructor Details
#initialize ⇒ SoapContext
attr_reader :token, :user_agent, :target_server
8 9 10 11 12 13 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 8 def initialize @token = nil @user_agent = 'zmsoap' @target_server = nil @account = nil end |
Instance Method Details
#account(by, value) ⇒ Object
30 31 32 33 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 30 def account(by, value) @account = { by: by, _content: value } self end |
#target_server(str) ⇒ Object
25 26 27 28 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 25 def target_server(str) @target_server = str self end |
#to_hash ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 35 def to_hash h = { authToken: @token, userAgent: { name: @user_agent }, account: @account, targetServer: @target_server } h.compact! h end |
#token(str) ⇒ Object
15 16 17 18 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 15 def token(str) @token = str self end |
#user_agent(str) ⇒ Object
20 21 22 23 |
# File 'lib/zm/client/soap_request/soap_context.rb', line 20 def user_agent(str) @user_agent = str self end |