Class: NetSuite::Records::CustomerAddressbookList

Inherits:
Object
  • Object
show all
Includes:
Namespaces::ListRel
Defined in:
lib/netsuite/records/customer_addressbook_list.rb

Instance Method Summary collapse

Methods included from Namespaces::ListRel

#record_namespace

Constructor Details

#initialize(attributes = {}) ⇒ CustomerAddressbookList

Returns a new instance of CustomerAddressbookList.



6
7
8
9
10
11
12
13
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 6

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

Instance Method Details

#addressbooksObject



15
16
17
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 15

def addressbooks
  @addressbooks ||= []
end

#to_recordObject



19
20
21
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 19

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