Sha256: 29e858c6cf760cd0215d1c968e0732c7ad88f0b099223418bc69ba42496766c8

Contents?: true

Size: 1.65 KB

Versions: 44

Compression:

Stored size: 1.65 KB

Contents

module NetSuite
  module Records
    class CustomerAddressbook
      include Support::Fields
      include Support::Records
      include Namespaces::ListRel

      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
      attr_accessor :external_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

44 entries across 44 versions & 1 rubygems

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