Sha256: 90bdc80cb1f054a000a0c6740face8aa03487609b4cbcad63cd8d0ab50f66696

Contents?: true

Size: 616 Bytes

Versions: 44

Compression:

Stored size: 616 Bytes

Contents

module NetSuite
  module Records
    class CustomerAddressbookList
      include Namespaces::ListRel

      def initialize(attributes = {})
        case attributes[:addressbook]
        when Hash
          addressbooks << CustomerAddressbook.new(attributes[:addressbook])
        when Array
          attributes[:addressbook].each { |addressbook| addressbooks << CustomerAddressbook.new(addressbook) }
        end
      end

      def addressbooks
        @addressbooks ||= []
      end

      def to_record
        { "#{record_namespace}:addressbook" => addressbooks.map(&:to_record) }
      end

    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
netsuite-0.2.6 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.5 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.4 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.3 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.2 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.1 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.2.0 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.1.0 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.50 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.49 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.48 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.47 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.45 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.44 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.43 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.42 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.41 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.40 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.39 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.38 lib/netsuite/records/customer_addressbook_list.rb