Class: Stic::File
Overview
Represent an output blob containing data from a single source file.
Subclasses can override the ‘render` method to implement processing logic.
Direct Known Subclasses
Instance Attribute Summary
Attributes included from Readable
Attributes included from SiteBase
Instance Method Summary collapse
-
#url_template ⇒ Path
Return site relative URL.
Methods included from Readable
#content, #initialize, #read, #render, #source_path
Methods inherited from Blob
#mime_type, #relative_target_path, #relative_url, #target_path, #to_s, #write
Methods included from SiteBase
Instance Method Details
#url_template ⇒ Path
Return site relative URL.
File blobs do not have a variable URL template by default so the #url_template is equal the Blob#relative_url and consists of the blob Readable#path and the blob file Readable#name.
As subclasses can override #url_template with custom behavior the file blob class does not override the placeholder replacement login in Blob#relative_url but #url_template that returns a URL without placeholders.
27 28 29 |
# File 'lib/stic/file.rb', line 27 def url_template path.dirname.join(name).as_absolute end |