Class: Fir::TemplateAdapter

Inherits:
Object
  • Object
show all
Includes:
TemplateLoading
Defined in:
lib/fir/pages.rb

Direct Known Subclasses

ErbAdapter, NoOpAdapter

Instance Method Summary collapse

Constructor Details

#initialize(template_path) ⇒ TemplateAdapter

Returns a new instance of TemplateAdapter.



110
111
112
113
114
# File 'lib/fir/pages.rb', line 110

def initialize(template_path)
	# ERB uses the template adapter's bindings, so we don't want to pollute the
	# namespace any more than we have too. Thus the two preceding underscores.
	@__path = template_path
end

Instance Method Details

#render_with_layout(options) ⇒ Object



116
117
118
119
120
121
122
# File 'lib/fir/pages.rb', line 116

def render_with_layout(options)
	wrapper_template.render(options) do
		# This block will be called where "yield" appears in the wrapper template.
		# See comment on ErbAdapter#render.
		render(options)
	end
end