Module: Brine::MustacheExpanding
- Included in:
- Brine
- Defined in:
- lib/brine/mustache_expanding.rb
Overview
Provide a binding environment and template expansion that can use such an environment.
Defined Under Namespace
Classes: BrineTemplate
Instance Method Summary collapse
-
#as_template(str) ⇒ BrineTemplate
Allow retrieval of BrineTemplates for provided template content.
-
#bind(key, value) ⇒ Object
Assign ‘value’ to ‘key’ within binding,.
-
#binding ⇒ Hash<String, Object>
Furnish a mutable hash to serve as a binding environment.
Instance Method Details
#as_template(str) ⇒ BrineTemplate
Allow retrieval of BrineTemplates for provided template content.
81 82 83 |
# File 'lib/brine/mustache_expanding.rb', line 81 def as_template(str) BrineTemplate.new(str) end |
#bind(key, value) ⇒ Object
Assign ‘value’ to ‘key’ within binding,
28 29 30 31 |
# File 'lib/brine/mustache_expanding.rb', line 28 def bind(key, value) STDERR.puts "Assigning #{value} to #{key}" if ENV['BRINE_LOG_BINDING'] binding[key] = value end |
#binding ⇒ Hash<String, Object>
Furnish a mutable hash to serve as a binding environment.
18 19 20 |
# File 'lib/brine/mustache_expanding.rb', line 18 def binding @binding ||= {} end |