Class: RubyOmx::PurchaseOrderUpdateRequest

Inherits:
Request show all
Defined in:
lib/ruby_omx/request/purchase_order_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 = {}) ⇒ PurchaseOrderUpdateRequest

Returns a new instance of PurchaseOrderUpdateRequest.



5
6
7
8
9
10
11
12
13
# File 'lib/ruby_omx/request/purchase_order_update_request.rb', line 5

def initialize(attrs={})
  return super unless attrs.any?
  raise MissingRequestOptions if (attrs[:po_number].nil? && attrs[:supplier_id].nil?)
  super
  self.version = attrs[:version] ||= '1.00'

  # Instantiate LineItem variables for each
  self.line_items = attrs[:line_items].collect { |h| LineItem.new(h) }
end