lib/netsuite/records/invoice.rb in netsuite-0.0.9 vs lib/netsuite/records/invoice.rb in netsuite-0.0.10

- old
+ new

@@ -42,9 +42,18 @@ def transaction_ship_address=(attrs) attributes[:transaction_ship_address] = ShipAddress.new(attrs) end + def item_list=(attrs) + attributes[:item_list] = case attrs[:item] + when Hash + InvoiceItemList.new(attrs[:item]) + when Array + attrs[:item].map { |item| InvoiceItemList.new(item) } + end + end + def self.get(id) response = Actions::Get.call(id, self) if response.success? new(response.body) else