lib/netsuite/actions/get.rb in netsuite-0.0.7 vs lib/netsuite/actions/get.rb in netsuite-0.0.8

- old
+ new

@@ -1,12 +1,13 @@ module NetSuite module Actions class Get include SavonSupport - def initialize(id) - @id = id + def initialize(id, klass) + @id = id + @klass = klass end private def request @@ -16,10 +17,14 @@ soap.header = auth_header soap.body = request_body end end + def soap_type + @klass.to_s.split('::').last.lower_camelcase + end + # <soap:Body> # <platformMsgs:get> # <platformMsgs:baseRef internalId="983" type="customer" xsi:type="platformCore:RecordRef"> # <platformCore:name/> # </platformMsgs:baseRef> @@ -29,10 +34,10 @@ { 'platformMsgs:baseRef' => {}, :attributes! => { 'platformMsgs:baseRef' => { :internalId => @id, - :type => 'customer', + :type => soap_type, 'xsi:type' => 'platformCore:RecordRef' } } } end