Class: IntacctRuby::Functions::CreateCustomer

Inherits:
CustomerBaseFunction show all
Defined in:
lib/intacct_ruby/functions/create_customer.rb

Overview

function that creates customer instance

Instance Method Summary collapse

Methods included from ContactsHelper

#contact_params, #contactname, #full_name

Constructor Details

#initialize(attrs = {}) ⇒ CreateCustomer

Returns a new instance of CreateCustomer.



8
9
10
# File 'lib/intacct_ruby/functions/create_customer.rb', line 8

def initialize(attrs = {})
  super "create_customer_#{attrs[:customerid]}", attrs
end

Instance Method Details

#to_xmlObject



12
13
14
15
16
17
18
19
20
# File 'lib/intacct_ruby/functions/create_customer.rb', line 12

def to_xml
  super do |xml|
    xml.create_customer do
      xml.customerid @attrs[:customerid]

      xml << customer_params
    end
  end
end