Class: OodAppkit::Urls::Files

Inherits:
OodAppkit::Url show all
Defined in:
lib/ood_appkit/urls/files.rb

Overview

A class used to handle URLs for the system Files app.

Instance Attribute Summary

Attributes inherited from OodAppkit::Url

#title

Instance Method Summary collapse

Constructor Details

#initialize(fs_url: '/fs', api_url: '/api/v1/fs', template: '{/url*}{+path}', **kwargs) ⇒ Files



8
9
10
11
12
# File 'lib/ood_appkit/urls/files.rb', line 8

def initialize(fs_url: '/fs', api_url: '/api/v1/fs', template: '{/url*}{+path}', **kwargs)
  super(template: template, **kwargs)
  @fs_url  = parse_url_segments(fs_url.to_s)
  @api_url = parse_url_segments(api_url.to_s)
end

Instance Method Details

#api(path: '') ⇒ Addressable::URI

URL to access this app’s API for a given absolute file path



24
25
26
# File 'lib/ood_appkit/urls/files.rb', line 24

def api(path: '')
  @template.expand url: @base_url + @api_url, path: path.to_s
end

#url(path: '') ⇒ Addressable::URI

URL to access this app for a given absolute file path



17
18
19
# File 'lib/ood_appkit/urls/files.rb', line 17

def url(path: '')
  @template.expand url: @base_url + @fs_url, path: path.to_s
end