Class: CnpOnline::RecyclingRequest

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

Class Method Summary collapse

Class Method Details

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



1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/XMLFields.rb', line 1107

def self.from_hash(hash, name='recyclingRequest')
  base = hash[name]
  if(base)
    this = RecyclingRequest.new
    this.recycleBy = base['recycleBy']
    this.recycleId = base['recycleId']
    SchemaValidation.validate_enum(this.recycleBy, false, ['Merchant','Cnp','None'], name, 'recycleBy')
    SchemaValidation.validate_length(this.recycleId, false, 1, 25, name, 'recycleId')
    this
  else
    nil
  end
end