Sha256: a0ab740866c4d8df09343b572dee5c1943c41e91987c7445b3bb112fd11f8175

Contents?: true

Size: 622 Bytes

Versions: 9

Compression:

Stored size: 622 Bytes

Contents

# frozen_string_literal: true

require_relative 'subsidiary'

module LedgerSync
  module Ledgers
    module NetSuiteSOAP
      class Customer < NetSuiteSOAP::Resource
        attribute :email, type: LedgerSync::Type::String
        attribute :name, type: LedgerSync::Type::String
        attribute :phone_number, type: LedgerSync::Type::String

        references_one :subsidiary, to: Subsidiary

        def first_name
          return if name.nil?

          name.split(' ').first
        end

        def last_name
          return if name.nil?

          name.split(' ')[1..-1]
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ledger_sync-1.7.0 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.6.0 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.5.2 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.5.1 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.5.0 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.4.4 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/netsuite_soap/resources/customer.rb