Class: Machined::Processors::LayoutProcessor
- Inherits:
-
Tilt::Template
- Object
- Tilt::Template
- Machined::Processors::LayoutProcessor
- Defined in:
- lib/machined/processors/layout_processor.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
A reference to the Sprockets context.
-
#layout_path ⇒ Object
readonly
Path to the layout file.
Instance Method Summary collapse
-
#evaluate(context, locals, &block) ⇒ Object
See ‘Tilt::Template#evaluate`.
-
#prepare ⇒ Object
See ‘Tilt::Template#prepare`.
Instance Attribute Details
#context ⇒ Object (readonly)
A reference to the Sprockets context
7 8 9 |
# File 'lib/machined/processors/layout_processor.rb', line 7 def context @context end |
#layout_path ⇒ Object (readonly)
Path to the layout file
10 11 12 |
# File 'lib/machined/processors/layout_processor.rb', line 10 def layout_path @layout_path end |
Instance Method Details
#evaluate(context, locals, &block) ⇒ Object
See ‘Tilt::Template#evaluate`.
17 18 19 20 21 22 23 24 25 |
# File 'lib/machined/processors/layout_processor.rb', line 17 def evaluate(context, locals, &block) @context = context if layout? && @layout_path = resolve_layout context.depend_on @layout_path evaluate_layout else data end end |
#prepare ⇒ Object
See ‘Tilt::Template#prepare`.
13 14 |
# File 'lib/machined/processors/layout_processor.rb', line 13 def prepare end |