Class: Ingenico::Direct::SDK::Domain::SessionResponse

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/session_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#asset_urlString

Returns the current value of asset_url.

Returns:

  • (String)

    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_urlString

Returns the current value of client_api_url.

Returns:

  • (String)

    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_idString

Returns the current value of client_session_id.

Returns:

  • (String)

    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_idString

Returns the current value of customer_id.

Returns:

  • (String)

    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_tokensArray<String>

Returns the current value of invalid_tokens.

Returns:

  • (Array<String>)

    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_hHash

Returns:

  • (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