Sha256: 82d1cb1a8ceacc7f6f4c11a39afbe62d58a07971d2dce30038eb2214f3cf8971

Contents?: true

Size: 1.5 KB

Versions: 13

Compression:

Stored size: 1.5 KB

Contents

# frozen_string_literal: true

module LedgerSync
  module QuickBooksOnline
    class DashboardURLHelper < LedgerSync::Ledgers::DashboardURLHelper
      def resource_path # rubocop:disable Metrics/CyclomaticComplexity
        @resource_path = case resource
                         when QuickBooksOnline::Account
                           "/register?accountId=#{resource.ledger_id}"
                         when QuickBooksOnline::Bill
                           "/bill?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::Customer
                           "/customerdetail?nameId=#{resource.ledger_id}"
                         when QuickBooksOnline::Deposit
                           "/deposit?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::Expense
                           "/expense?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::JournalEntry
                           "/journal?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::LedgerClass
                           '/class'
                         when QuickBooksOnline::Payment
                           "/recvpayment?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::Transfer
                           "/transfer?txnId=#{resource.ledger_id}"
                         when QuickBooksOnline::Vendor
                           "/vendordetail?nameId=#{resource.ledger_id}"
                         end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ledger_sync-quickbooks_online-2.0.0 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-1.0.1 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-1.0.0 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.4.0 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.3.1 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.3.0 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.6 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.5 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.4 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.2 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.1 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.2.0 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb
ledger_sync-quickbooks_online-0.1.1 lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb