Class: Ingenico::Direct::SDK::Domain::SessionResponse
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::SessionResponse
- Defined in:
- lib/ingenico/direct/sdk/domain/session_response.rb
Instance Attribute Summary collapse
-
#asset_url ⇒ String
The current value of asset_url.
-
#client_api_url ⇒ String
The current value of client_api_url.
-
#client_session_id ⇒ String
The current value of client_session_id.
-
#customer_id ⇒ String
The current value of customer_id.
-
#invalid_tokens ⇒ Array<String>
The current value of invalid_tokens.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#asset_url ⇒ String
Returns the current value of asset_url.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 15 def asset_url @asset_url end |
#client_api_url ⇒ String
Returns the current value of client_api_url.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 15 def client_api_url @client_api_url end |
#client_session_id ⇒ String
Returns the current value of client_session_id.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 15 def client_session_id @client_session_id end |
#customer_id ⇒ String
Returns the current value of customer_id.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 15 def customer_id @customer_id end |
#invalid_tokens ⇒ Array<String>
Returns the current value of invalid_tokens.
15 16 17 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 15 def invalid_tokens @invalid_tokens end |
Instance Method Details
#from_hash(hash) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 33 def from_hash(hash) super @asset_url = hash['assetUrl'] if hash.key? 'assetUrl' @client_api_url = hash['clientApiUrl'] if hash.key? 'clientApiUrl' @client_session_id = hash['clientSessionId'] if hash.key? 'clientSessionId' @customer_id = hash['customerId'] if hash.key? 'customerId' if hash.key? 'invalidTokens' raise TypeError, "value '%s' is not an Array" % [hash['invalidTokens']] unless hash['invalidTokens'].is_a? Array @invalid_tokens = [] hash['invalidTokens'].each do |e| @invalid_tokens << e end end end |
#to_h ⇒ Hash
23 24 25 26 27 28 29 30 31 |
# File 'lib/ingenico/direct/sdk/domain/session_response.rb', line 23 def to_h hash = super hash['assetUrl'] = @asset_url unless @asset_url.nil? hash['clientApiUrl'] = @client_api_url unless @client_api_url.nil? hash['clientSessionId'] = @client_session_id unless @client_session_id.nil? hash['customerId'] = @customer_id unless @customer_id.nil? hash['invalidTokens'] = @invalid_tokens unless @invalid_tokens.nil? hash end |