Class: NetSuite::Actions::Initialize
- Inherits:
-
AbstractAction
- Object
- AbstractAction
- NetSuite::Actions::Initialize
- Includes:
- Support::Requests
- Defined in:
- lib/netsuite/actions/initialize.rb
Defined Under Namespace
Modules: Support
Instance Method Summary collapse
- #action_name ⇒ Object
-
#initialize(klass, object) ⇒ Initialize
constructor
A new instance of Initialize.
-
#request_body ⇒ Object
<platformMsgs:initializeRecord> <platformCore:type>invoice</platformCore:type> <platformCore:reference internalId=“1513” type=“salesOrder”> <platformCore:name>1511</platformCore:name> </platformCore:reference> </platformMsgs:initializeRecord>.
- #request_options ⇒ Object
- #response_body ⇒ Object
- #response_hash ⇒ Object
- #success? ⇒ Boolean
Methods included from Support::Requests
Methods inherited from AbstractAction
Constructor Details
#initialize(klass, object) ⇒ Initialize
Returns a new instance of Initialize.
7 8 9 10 |
# File 'lib/netsuite/actions/initialize.rb', line 7 def initialize(klass, object) @klass = klass @object = object end |
Instance Method Details
#action_name ⇒ Object
55 56 57 |
# File 'lib/netsuite/actions/initialize.rb', line 55 def action_name :initialize end |
#request_body ⇒ Object
<platformMsgs:initializeRecord>
<platformCore:type>invoice</platformCore:type>
<platformCore:reference internalId="1513" type="salesOrder">
<platformCore:name>1511</platformCore:name>
</platformCore:reference>
</platformMsgs:initializeRecord>
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/netsuite/actions/initialize.rb', line 18 def request_body { 'platformMsgs:initializeRecord' => { 'platformCore:type' => NetSuite::Support::Records.netsuite_type(@klass), 'platformCore:reference' => {}, :attributes! => { 'platformCore:reference' => { 'internalId' => @object.internal_id, :type => NetSuite::Support::Records.netsuite_type(@object) } } } } end |
#request_options ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/netsuite/actions/initialize.rb', line 45 def { namespaces: { 'xmlns:platformMsgs' => "urn:messages_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com", 'xmlns:platformCore' => "urn:core_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com", 'xmlns:platformCoreTyp' => "urn:types.core_#{NetSuite::Configuration.api_version}.platform.webservices.netsuite.com", } } end |
#response_body ⇒ Object
41 42 43 |
# File 'lib/netsuite/actions/initialize.rb', line 41 def response_body @response_body ||= response_hash[:record] end |
#response_hash ⇒ Object
33 34 35 |
# File 'lib/netsuite/actions/initialize.rb', line 33 def response_hash @response_hash ||= @response.to_hash[:initialize_response][:read_response] end |
#success? ⇒ Boolean
37 38 39 |
# File 'lib/netsuite/actions/initialize.rb', line 37 def success? @success ||= response_hash[:status][:@is_success] == 'true' end |