Class: OodAppkit::Url
- Inherits:
-
Object
- Object
- OodAppkit::Url
- Defined in:
- lib/ood_appkit/url.rb
Overview
A generic class used to handle URLs for an app
Direct Known Subclasses
OodAppkit::Urls::Dashboard, OodAppkit::Urls::Editor, OodAppkit::Urls::Files, OodAppkit::Urls::Public, OodAppkit::Urls::Shell
Instance Attribute Summary collapse
-
#title ⇒ String
readonly
The title for this URL.
Instance Method Summary collapse
-
#initialize(title: '', base_url: '/', template: '{/url*}/') ⇒ Url
constructor
A new instance of Url.
-
#url ⇒ Addressable::URI
URL to access this app.
Constructor Details
#initialize(title: '', base_url: '/', template: '{/url*}/') ⇒ Url
Returns a new instance of Url.
14 15 16 17 18 |
# File 'lib/ood_appkit/url.rb', line 14 def initialize(title: '', base_url: '/', template: '{/url*}/') @title = title.to_s @template = Addressable::Template.new template.to_s @base_url = parse_url_segments(base_url.to_s) end |
Instance Attribute Details
#title ⇒ String (readonly)
The title for this URL
8 9 10 |
# File 'lib/ood_appkit/url.rb', line 8 def title @title end |
Instance Method Details
#url ⇒ Addressable::URI
URL to access this app
22 23 24 |
# File 'lib/ood_appkit/url.rb', line 22 def url @template. url: @base_url end |