Class: RubyOmx::ItemUpdateRequest

Inherits:
Request show all
Defined in:
lib/ruby_omx/request/item_update_request.rb

Instance Attribute Summary

Attributes inherited from Request

#raw_xml

Instance Method Summary collapse

Methods inherited from Response

format, parse_xml

Methods inherited from Node

#accessors, #as_hash

Constructor Details

#initialize(attrs = {}) ⇒ ItemUpdateRequest

Returns a new instance of ItemUpdateRequest.



29
30
31
32
33
34
35
36
# File 'lib/ruby_omx/request/item_update_request.rb', line 29

def initialize(attrs={})
  return super unless attrs.any?
  required_fields = [:items] #:item_code, :product_status, :product_name, :product_group, :tax_code, :file_sub_code, :inventory_product_flag, :launch_date
raise MissingRequestOptions if required_fields.any? { |option| attrs[option].nil? }  		
  super
  self.version = attrs[:version] ||= '2.00'
  self.items = attrs[:items].collect { |h| ItemUpdateItem.new(h) }
end