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.
- #replace_all ⇒ Object
- #replace_all=(new_replace_all) ⇒ Object
- #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 14 15 |
# 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 @replace_all = true end |
Instance Method Details
#addressbooks ⇒ Object
17 18 19 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 17 def addressbooks @addressbooks ||= [] end |
#replace_all ⇒ Object
21 22 23 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 21 def replace_all @replace_all end |
#replace_all=(new_replace_all) ⇒ Object
25 26 27 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 25 def replace_all= new_replace_all @replace_all = !!new_replace_all end |
#to_record ⇒ Object
29 30 31 32 33 |
# File 'lib/netsuite/records/customer_addressbook_list.rb', line 29 def to_record { "#{record_namespace}:addressbook" => addressbooks.map(&:to_record), "#{record_namespace}:replaceAll" => @replace_all } end |