class Ingenico::Direct::SDK::Domain::SessionRequest

@attr [Array<String>] tokens

Attributes

tokens[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/direct/sdk/domain/session_request.rb, line 21
def from_hash(hash)
  super
  if hash.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() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# File lib/ingenico/direct/sdk/domain/session_request.rb, line 15
def to_h
  hash = super
  hash['tokens'] = @tokens unless @tokens.nil?
  hash
end