Class: LedgerSync::Ledgers::DashboardURLHelper
- Inherits:
-
Object
- Object
- LedgerSync::Ledgers::DashboardURLHelper
- Defined in:
- lib/ledger_sync/ledgers/dashboard_url_helper.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ DashboardURLHelper
constructor
A new instance of DashboardURLHelper.
- #resource_path ⇒ Object
- #url ⇒ Object
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_url ⇒ Object (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 |
#resource ⇒ Object (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_path ⇒ Object
18 19 20 |
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 18 def resource_path raise NotImplementedError end |
#url ⇒ Object
14 15 16 |
# File 'lib/ledger_sync/ledgers/dashboard_url_helper.rb', line 14 def url File.join(base_url, resource_path) end |