Class: CnpOnline::UpdateAddOn

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

Class Method Summary collapse

Class Method Details

.from_hash(hash, index = 0, name = "updateAddOn") ⇒ Object



1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
# File 'lib/XMLFields.rb', line 1300

def self.from_hash(hash,index=0, name="updateAddOn")
  base = hash[name][index]
  if(base)
    this = UpdateAddOn.new
    this.addOnCode = base['addOnCode']
    this.name = base['name']
    this.amount = base['amount']
    this.startDate = base['startDate']
    this.endDate = base['endDate']
    SchemaValidation.validate_length(this.addOnCode, true, 1, 25, name, 'addOnCode')
    SchemaValidation.validate_length(this.name, false, 1, 100, name, "name")
    SchemaValidation.validate_size(this.amount,false,0,999999999999,name,'amount')
    SchemaValidation.validate_date(this.startDate, false, name, 'startDate')
    SchemaValidation.validate_date(this.endDate, false, name, 'endDate')
    this
  end
end