Class: Handlebars::Helpers::WithHelper
- Inherits:
-
DefaultHelper
- Object
- DefaultHelper
- Handlebars::Helpers::WithHelper
- Defined in:
- lib/ruby-handlebars/helpers/with_helper.rb
Class Method Summary collapse
- .apply(context, data, block, else_block) ⇒ Object
- .apply_as(context, data, name, block, else_block) ⇒ Object
- .registry_name ⇒ Object
Methods inherited from DefaultHelper
Class Method Details
.apply(context, data, block, else_block) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/ruby-handlebars/helpers/with_helper.rb', line 10 def self.apply(context, data, block, else_block) if data context.with_temporary_context(data) do block.fn(context) end else else_block.fn(context) end end |
.apply_as(context, data, name, block, else_block) ⇒ Object
20 21 22 |
# File 'lib/ruby-handlebars/helpers/with_helper.rb', line 20 def self.apply_as(context, data, name, block, else_block) self.apply(context, { name.to_sym => data }, block, else_block) end |
.registry_name ⇒ Object
6 7 8 |
# File 'lib/ruby-handlebars/helpers/with_helper.rb', line 6 def self.registry_name 'with' end |