Class: Machined::Processors::LayoutProcessor

Inherits:
Tilt::Template
  • Object
show all
Defined in:
lib/machined/processors/layout_processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject (readonly)

A reference to the Sprockets context



7
8
9
# File 'lib/machined/processors/layout_processor.rb', line 7

def context
  @context
end

#layout_pathObject (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

#prepareObject

See ‘Tilt::Template#prepare`.



13
14
# File 'lib/machined/processors/layout_processor.rb', line 13

def prepare
end