1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
|
# File 'lib/XMLFields.rb', line 1182
def self.from_hash(hash, name="subscription")
base = hash[name]
if(base)
this = Subscription.new
this.planCode = base['planCode']
this.numberOfPayments = base['numberOfPayments']
this.startDate = base['startDate']
this.amount = base['amount']
if(base['createDiscount'])
base['createDiscount'].each_index {|index| this.createDiscount << CreateDiscount.from_hash(base,index)}
end
if(base['createAddOn'])
base['createAddOn'].each_index {|index| this.createAddOn << CreateAddOn.from_hash(base,index)}
end
SchemaValidation.validate_length(this.planCode, true, 1, 25, name, 'planCode')
SchemaValidation.validate_size(this.numberOfPayments, false, 1, 99, name, 'numberOfPayments')
SchemaValidation.validate_date(this.startDate,false,name,'startDate')
SchemaValidation.validate_size(this.amount,false,0,999999999999,name,'amount')
this
end
end
|