Class: LedgerSync::Ledgers::DashboardURLHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/ledger_sync/ledgers/dashboard_url_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ DashboardURLHelper

Returns a new instance of DashboardURLHelper.



9
10
11
12
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 9

def initialize(args = {})
  @resource = args.fetch(:resource)
  @base_url = args.fetch(:base_url)
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



6
7
8
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 6

def base_url
  @base_url
end

#resourceObject (readonly)

Returns the value of attribute resource.



6
7
8
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 6

def resource
  @resource
end

Instance Method Details

#resource_pathObject

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 18

def resource_path
  raise NotImplementedError
end

#urlObject



14
15
16
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 14

def url
  File.join(base_url, resource_path)
end