Class: Yarrow::Output::Context
- Inherits:
-
Object
- Object
- Yarrow::Output::Context
- Includes:
- HTML::AssetTags
- Defined in:
- lib/yarrow/output/context.rb
Overview
Provides a data context for rendering a template.
Methods provided by this class become available as named variables in Mustache templates.
Includes the library of helpers for dynamically generating HTML tags.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Context
constructor
A new instance of Context.
Methods included from HTML::AssetTags
#base_url_path, #link_tag, #manifest, #script_tag, #script_tags
Methods included from Configurable
Constructor Details
#initialize(attributes) ⇒ Context
Returns a new instance of Context.
15 16 17 18 19 20 |
# File 'lib/yarrow/output/context.rb', line 15 def initialize(attributes) = class << self; self; end attributes.each do |name, value| .send :define_method, name, lambda { value } end end |