Class: LedgerSync::QuickBooksOnline::DashboardURLHelper

Inherits:
Ledgers::DashboardURLHelper
  • Object
show all
Defined in:
lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb

Instance Method Summary collapse

Instance Method Details

#resource_pathObject

rubocop:disable Metrics/CyclomaticComplexity



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ledger_sync/quickbooks_online/dashboard_url_helper.rb', line 6

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