Class: OodAppkit::Urls::Editor
- Inherits:
-
OodAppkit::Url
- Object
- OodAppkit::Url
- OodAppkit::Urls::Editor
- Defined in:
- lib/ood_appkit/urls/editor.rb
Overview
A class used to handle URLs for the system file Editor app.
Instance Attribute Summary
Attributes inherited from OodAppkit::Url
Instance Method Summary collapse
-
#edit(path: '') ⇒ Addressable::URI
URL to access this app’s file editor API for a given absolute file path.
-
#initialize(edit_url: '/edit', template: '{/url*}{+path}', **kwargs) ⇒ Editor
constructor
A new instance of Editor.
Methods inherited from OodAppkit::Url
Constructor Details
#initialize(edit_url: '/edit', template: '{/url*}{+path}', **kwargs) ⇒ Editor
Returns a new instance of Editor.
7 8 9 10 |
# File 'lib/ood_appkit/urls/editor.rb', line 7 def initialize(edit_url: '/edit', template: '{/url*}{+path}', **kwargs) super(template: template, **kwargs) @edit_url = parse_url_segments(edit_url.to_s) end |
Instance Method Details
#edit(path: '') ⇒ Addressable::URI
URL to access this app’s file editor API for a given absolute file path
15 16 17 |
# File 'lib/ood_appkit/urls/editor.rb', line 15 def edit(path: '') @template. url: @base_url + @edit_url, path: path.to_s end |