Sha256: 3ce05e4364de21f786d39bd8e91f338c9259a718ed406cbda3ee2e10ed5db67a

Contents?: true

Size: 752 Bytes

Versions: 4

Compression:

Stored size: 752 Bytes

Contents

module NetSuite
  module Records
    class ItemFulfillmentPackageUpsList
      include Support::Fields
      include Support::Records
      include Namespaces::TranSales

      fields :package_ups

      def initialize(attributes = {})
        initialize_from_attributes_hash(attributes)
      end

      def package_ups=(packages)
        case packages
        when Hash
          self.packages << ItemFulfillmentPackageUps.new(packages)
        when Array
          packages.each { |package| self.packages << ItemFulfillmentPackageUps.new(package) }
        end
      end

      def packages
        @packages ||= []
      end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
netsuite-0.9.3 lib/netsuite/records/item_fulfillment_package_ups_list.rb
netsuite-0.9.2 lib/netsuite/records/item_fulfillment_package_ups_list.rb
netsuite-0.9.1 lib/netsuite/records/item_fulfillment_package_ups_list.rb
netsuite-0.9.0 lib/netsuite/records/item_fulfillment_package_ups_list.rb