Sha256: 56b1314c9e945bc023d47ad9226e8fe61ad620d7b34e5967070fc934fb33c115

Contents?: true

Size: 1.58 KB

Versions: 6

Compression:

Stored size: 1.58 KB

Contents

module NetSuite
  module Records
    class CustomerAddressbookList
      include FieldSupport
      include RecordSupport

      fields :default_shipping, :default_billing, :is_residential, :label, :attention, :addressee,
        :phone, :addr1, :addr2, :addr3, :city, :zip, :country, :addr_text, :override, :state

      attr_reader :internal_id

      def initialize(attributes_or_record = {})
        case attributes_or_record
        when self.class
          initialize_from_record(attributes_or_record)
        when Hash
          attributes_or_record = attributes_or_record[:addressbook] if attributes_or_record[:addressbook]
          @internal_id = attributes_or_record.delete(:internal_id)
          initialize_from_attributes_hash(attributes_or_record)
        end
      end

      def initialize_from_record(obj)
        self.default_shipping = obj.default_shipping
        self.default_billing  = obj.default_billing
        self.is_residential   = obj.is_residential
        self.label            = obj.label
        self.attention        = obj.attention
        self.addressee        = obj.addressee
        self.phone            = obj.phone
        self.addr1            = obj.addr1
        self.addr2            = obj.addr2
        self.addr3            = obj.addr3
        self.city             = obj.city
        self.zip              = obj.zip
        self.country          = obj.country
        self.addr_text        = obj.addr_text
        self.override         = obj.override
        self.state            = obj.state
        @internal_id          = obj.internal_id
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
netsuite-0.0.10 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.9 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.8 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.7 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.6 lib/netsuite/records/customer_addressbook_list.rb
netsuite-0.0.5 lib/netsuite/records/customer_addressbook_list.rb