class Handlebars::Helpers::WithHelper

Public Class Methods

apply(context, data, block, else_block) click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# File lib/ruby-handlebars/helpers/with_helper.rb, line 6
def self.registry_name
  'with'
end