Class: LitleOnline::EcheckToken

Inherits:
Object
  • Object
show all
Includes:
XML::Mapping
Defined in:
lib/XMLFields.rb

Class Method Summary collapse

Class Method Details

.from_hash(hash, name = 'echeckToken') ⇒ Object



954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
# File 'lib/XMLFields.rb', line 954

def self.from_hash(hash, name='echeckToken')
  base = hash[name]
  if(base)
    this = EcheckToken.new
    this.litleToken = base['litleToken']
    this.routingNum = base['routingNum']
    this.accType = base['accType']
    this.checkNum = base['checkNum']
    SchemaValidation.validate_length(this.litleToken, true, 13, 25, name, 'litleToken')
    SchemaValidation.validate_length(this.routingNum, true, 9, 9, name, 'routingNum')
    SchemaValidation.validate_enum(this.accType, true, ['Checking','Savings','Corporate','Corp Savings'], name, 'accType')
    SchemaValidation.validate_length(this.checkNum, false, 1, 15, name, 'checkNum')
    this
  else
    nil
  end
end