Sha256: 205eb238c5c84b02fe74cd2ba19e29f90bd9c6905b15d789a097f9714aab2265

Contents?: true

Size: 768 Bytes

Versions: 4

Compression:

Stored size: 768 Bytes

Contents

# frozen_string_literal: true

module LedgerSync
  module Ledgers
    module QuickBooksOnline
      class Department
        class Deserializer < QuickBooksOnline::Deserializer
          id

          attribute :name,
                    hash_attribute: 'Name'
          attribute :active,
                    hash_attribute: 'Active'
          attribute :sub_department,
                    hash_attribute: 'SubDepartment'
          attribute :fully_qualified_name,
                    hash_attribute: 'FullyQualifiedName'

          attribute(:parent) do |args = {}|
            hash = args.fetch(:hash)

            LedgerSync::QuickBooks::Department.new(ledger_id: hash['ParentRef']) if hash['ParentRef'].nil?
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ledger_sync-1.4.4 lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb
ledger_sync-1.4.2 lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb
ledger_sync-1.4.1 lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb
ledger_sync-1.4.0 lib/ledger_sync/ledgers/quickbooks_online/department/deserializer.rb