Class: OnlinePayments::SDK::Domain::CreateHostedFieldsSessionRequest

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#localeString

Returns the current value of locale.

Returns:

  • (String)

    the current value of locale



11
12
13
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 11

def locale
  @locale
end

#tokensArray<String>

Returns the current value of tokens.

Returns:

  • (Array<String>)

    the current value of tokens



11
12
13
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 11

def tokens
  @tokens
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 25

def from_hash(hash)
  super
  if hash.has_key? 'locale'
    @locale = hash['locale']
  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_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# File 'lib/onlinepayments/sdk/domain/create_hosted_fields_session_request.rb', line 18

def to_h
  hash = super
  hash['locale'] = @locale unless @locale.nil?
  hash['tokens'] = @tokens unless @tokens.nil?
  hash
end