Class: NetSuite::Records::CustomerAddressbookList
- Inherits:
-
Object
- Object
- NetSuite::Records::CustomerAddressbookList
- Includes:
- Namespaces::ListRel
- Defined in:
- lib/netsuite/records/customer_addressbook_list.rb
Instance Method Summary collapse
- #addressbooks ⇒ Object
-
#initialize(attributes = {}) ⇒ CustomerAddressbookList
constructor
A new instance of CustomerAddressbookList.
- #to_record ⇒ Object
Methods included from Namespaces::ListRel
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
#addressbooks ⇒ Object
15 16 17 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 15 def addressbooks @addressbooks ||= [] end |
#to_record ⇒ Object
19 20 21 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 19 def to_record { "#{record_namespace}:addressbook" => addressbooks.map(&:to_record) } end |