Class: RubyOmx::ItemPriceUpdateRequest
- Defined in:
- lib/ruby_omx/request/item_price_update_request.rb
Instance Attribute Summary collapse
-
#item_code ⇒ Object
Returns the value of attribute item_code.
-
#keycode ⇒ Object
Returns the value of attribute keycode.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ ItemPriceUpdateRequest
constructor
A new instance of ItemPriceUpdateRequest.
Methods inherited from Response
Methods inherited from Node
Constructor Details
#initialize(attrs = {}) ⇒ ItemPriceUpdateRequest
Returns a new instance of ItemPriceUpdateRequest.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ruby_omx/request/item_price_update_request.rb', line 13 def initialize(attrs={}) return super unless attrs.any? required_fields = [:item_code] #: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] ||= '1.00' self.type = attrs[:keycode] ? 'Keycode' : 'DefaultPrice' # There are only 2 options, and if keycode is provided, it must be of type keycode, otherwise default self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'ItemCode', :value=>attrs[:item_code]}) self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'Type', :value=>self.type}) self.udi_parameters << RubyOmx::UDIParameter.new({:key=>'Keycode', :value=>attrs[:keycode]}) if attrs[:keycode] self.price_points = attrs[:price_points].collect { |h| PricePoint.new(h) } end |
Instance Attribute Details
#item_code ⇒ Object
Returns the value of attribute item_code.
26 27 28 |
# File 'lib/ruby_omx/request/item_price_update_request.rb', line 26 def item_code @item_code end |
#keycode ⇒ Object
Returns the value of attribute keycode.
26 27 28 |
# File 'lib/ruby_omx/request/item_price_update_request.rb', line 26 def keycode @keycode end |
#type ⇒ Object
Returns the value of attribute type.
26 27 28 |
# File 'lib/ruby_omx/request/item_price_update_request.rb', line 26 def type @type end |