Class: Handlebarsjs::HandlebarsConfiguration
- Inherits:
-
Object
- Object
- Handlebarsjs::HandlebarsConfiguration
- Includes:
- KLog::Logging
- Defined in:
- lib/handlebarsjs/handlebars_configuration.rb
Overview
Configuration data such has helpers for handlebarsjs
Defined Under Namespace
Classes: HelperConfig
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#helpers ⇒ Object
Returns the value of attribute helpers.
Instance Method Summary collapse
- #helper(name, helper, aliases: []) ⇒ Object
-
#initialize ⇒ HandlebarsConfiguration
constructor
A new instance of HandlebarsConfiguration.
Constructor Details
#initialize ⇒ HandlebarsConfiguration
Returns a new instance of HandlebarsConfiguration.
11 12 13 14 |
# File 'lib/handlebarsjs/handlebars_configuration.rb', line 11 def initialize @helpers = [] @defaults = Handlebarsjs::HandlebarsConfigurationDefaults.new end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
9 10 11 |
# File 'lib/handlebarsjs/handlebars_configuration.rb', line 9 def defaults @defaults end |
#helpers ⇒ Object
Returns the value of attribute helpers.
8 9 10 |
# File 'lib/handlebarsjs/handlebars_configuration.rb', line 8 def helpers @helpers end |
Instance Method Details
#helper(name, helper, aliases: []) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/handlebarsjs/handlebars_configuration.rb', line 18 def helper(name, helper, aliases: []) names = [name.to_sym] names = (names + aliases.map(&:to_sym)).uniq names.each do |helper_name| @helpers << HelperConfig.new(helper_name, helper) end end |