Class: Yass::LiquidTemplate::SourceDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Yass::LiquidTemplate::SourceDrop
show all
- Defined in:
- lib/yass/liquid_template.rb
Instance Method Summary
collapse
Constructor Details
#initialize(source) ⇒ SourceDrop
Returns a new instance of SourceDrop.
38
|
# File 'lib/yass/liquid_template.rb', line 38
def initialize(source) = @source = source
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(attr) ⇒ Object
60
|
# File 'lib/yass/liquid_template.rb', line 60
def method_missing(attr) = @source.front_matter[attr.to_s]
|
Instance Method Details
#content ⇒ Object
58
|
# File 'lib/yass/liquid_template.rb', line 58
def content = Renderer.new(@source).render(layout: false)
|
#dirname ⇒ Object
48
|
# File 'lib/yass/liquid_template.rb', line 48
def dirname = @source.dest_path.dirname.to_s
|
#extname ⇒ Object
52
|
# File 'lib/yass/liquid_template.rb', line 52
def extname = @source.dest_path.extname.to_s
|
#filename ⇒ Object
50
|
# File 'lib/yass/liquid_template.rb', line 50
def filename = @source.dest_path.basename.to_s
|
#filesize ⇒ Object
54
|
# File 'lib/yass/liquid_template.rb', line 54
def filesize = @source.size
|
#layout ⇒ Object
42
|
# File 'lib/yass/liquid_template.rb', line 42
def layout = @source.layout&.name
|
#path ⇒ Object
44
|
# File 'lib/yass/liquid_template.rb', line 44
def path = @source.dest_path.to_s
|
#published ⇒ Object
56
|
# File 'lib/yass/liquid_template.rb', line 56
def published = @source.published?
|
#src_path ⇒ Object
46
|
# File 'lib/yass/liquid_template.rb', line 46
def src_path = @source.src_path.to_s
|
#title ⇒ Object
40
|
# File 'lib/yass/liquid_template.rb', line 40
def title = @source.title
|