Class: OodAppkit::Urls::Shell
- Inherits:
-
OodAppkit::Url
- Object
- OodAppkit::Url
- OodAppkit::Urls::Shell
- Defined in:
- lib/ood_appkit/urls/shell.rb
Overview
A class used to handle URLs for the system Shell app.
Instance Attribute Summary
Attributes inherited from OodAppkit::Url
Instance Method Summary collapse
-
#initialize(ssh_url: '/ssh', template: '{/url*}/{host}{+path}', **kwargs) ⇒ Shell
constructor
A new instance of Shell.
-
#url(opts = {}) ⇒ Addressable::URI
URL to access this app for a given host and absolute file path.
Constructor Details
#initialize(ssh_url: '/ssh', template: '{/url*}/{host}{+path}', **kwargs) ⇒ Shell
Returns a new instance of Shell.
7 8 9 10 |
# File 'lib/ood_appkit/urls/shell.rb', line 7 def initialize(ssh_url: '/ssh', template: '{/url*}/{host}{+path}', **kwargs) super(template: template, **kwargs) @ssh_url = parse_url_segments(ssh_url.to_s) end |
Instance Method Details
#url(opts = {}) ⇒ Addressable::URI
URL to access this app for a given host and absolute file path
19 20 21 22 23 24 25 |
# File 'lib/ood_appkit/urls/shell.rb', line 19 def url(opts = {}) opts = opts.to_h.compact.symbolize_keys host = opts.fetch(:host, "default").to_s path = opts.fetch(:path, "").to_s @template. url: @base_url + @ssh_url, host: host, path: path end |