Class: OnlinePayments::SDK::Domain::SessionData
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::SessionData
- Defined in:
- lib/onlinepayments/sdk/domain/session_data.rb
Instance Attribute Summary collapse
-
#hosted_fields_session_id ⇒ String
The current value of hosted_fields_session_id.
-
#locale ⇒ String
The current value of locale.
-
#platform_url ⇒ String
The current value of platform_url.
-
#session_token ⇒ String
The current value of session_token.
-
#tokens ⇒ Array<String>
The current value of tokens.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#hosted_fields_session_id ⇒ String
Returns the current value of hosted_fields_session_id.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 14 def hosted_fields_session_id @hosted_fields_session_id end |
#locale ⇒ String
Returns the current value of locale.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 14 def locale @locale end |
#platform_url ⇒ String
Returns the current value of platform_url.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 14 def platform_url @platform_url end |
#session_token ⇒ String
Returns the current value of session_token.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 14 def session_token @session_token end |
#tokens ⇒ Array<String>
Returns the current value of tokens.
14 15 16 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 14 def tokens @tokens end |
Instance Method Details
#from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 37 def from_hash(hash) super if hash.has_key? 'hostedFieldsSessionId' @hosted_fields_session_id = hash['hostedFieldsSessionId'] end if hash.has_key? 'locale' @locale = hash['locale'] end if hash.has_key? 'platformUrl' @platform_url = hash['platformUrl'] end if hash.has_key? 'sessionToken' @session_token = hash['sessionToken'] end if hash.has_key? 'tokens' raise TypeError, "value '%s' is not an Array" % [hash['tokens']] unless hash['tokens'].is_a? Array @tokens = [] hash['tokens'].each do |e| @tokens << e end end end |
#to_h ⇒ Hash
27 28 29 30 31 32 33 34 35 |
# File 'lib/onlinepayments/sdk/domain/session_data.rb', line 27 def to_h hash = super hash['hostedFieldsSessionId'] = @hosted_fields_session_id unless @hosted_fields_session_id.nil? hash['locale'] = @locale unless @locale.nil? hash['platformUrl'] = @platform_url unless @platform_url.nil? hash['sessionToken'] = @session_token unless @session_token.nil? hash['tokens'] = @tokens unless @tokens.nil? hash end |