class OodAppkit::Urls::Editor
A class used to handle URLs for the system file Editor
app.
Public Class Methods
Source
# File lib/ood_appkit/urls/editor.rb, line 7 def initialize(edit_url: '/edit', template: '{/url*}{/fs}{+path}', **kwargs) super(template: template, **kwargs) @edit_url = parse_url_segments(edit_url.to_s) end
@param (see Url#initialize) @param edit_url [#to_s] the URL used to request the file editor api
Calls superclass method
OodAppkit::Url::new
Public Instance Methods
Source
# File lib/ood_appkit/urls/editor.rb, line 19 def edit(opts = {}) opts = opts.to_h.compact.symbolize_keys path = opts.fetch(:path, "").to_s fs = opts.fetch(:fs, "fs").to_s @template.expand url: @base_url + @edit_url, fs: fs, path: path end
URL to access this app’s file editor API for a given absolute file path @param opts [#to_h] the available options for this method @option opts [#to_s, nil] :path (“”) The absolute path to the file on
the filesystem
@option opts [#to_s, nil] :fs (“”) The filesystem for the path @return [Addressable::URI] absolute url to access path in file editor
api