Class: OnlinePayments::SDK::Domain::CreateHostedFieldsSessionRequest
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::CreateHostedFieldsSessionRequest
- Defined in:
- lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb
Instance Attribute Summary collapse
-
#locale ⇒ String
The current value of locale.
-
#origin ⇒ String
The current value of origin.
-
#tokens ⇒ Array<String>
The current value of tokens.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#locale ⇒ String
Returns the current value of locale.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12 def locale @locale end |
#origin ⇒ String
Returns the current value of origin.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12 def origin @origin end |
#tokens ⇒ Array<String>
Returns the current value of tokens.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 12 def tokens @tokens end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 29 def from_hash(hash) super if hash.has_key? 'locale' @locale = hash['locale'] end if hash.has_key? 'origin' @origin = hash['origin'] 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
21 22 23 24 25 26 27 |
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 21 def to_h hash = super hash['locale'] = @locale unless @locale.nil? hash['origin'] = @origin unless @origin.nil? hash['tokens'] = @tokens unless @tokens.nil? hash end |