Sha256: f2621943396c6c1dea1b0a8a4e397fcb72b0ae0ae0ff9069e42f3659ac0798e2

Contents?: true

Size: 695 Bytes

Versions: 28

Compression:

Stored size: 695 Bytes

Contents

module NetSuite
  module Records
    class VendorBillExpenseList
      include Support::Fields
      include Namespaces::TranPurch

      fields :expense

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

      def expense=(expenses)
        case expenses
          when Hash
            self.expenses << VendorBillExpense.new(expenses)
          when Array
            expenses.each { |expense| self.expenses << VendorBillExpense.new(expense) }
        end
      end

      def expenses
        @expenses ||= []
      end

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

    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
netsuite-0.6.7 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.6 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.5 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.4 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.3 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.2 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.1 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.6.0 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.9 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.8 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.7 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.6 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.5 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.4 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.3 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.2 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.1 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.5.0 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.4.9 lib/netsuite/records/vendor_bill_expense_list.rb
netsuite-0.4.8 lib/netsuite/records/vendor_bill_expense_list.rb