Sha256: 88bcd516975896569d1683d401d23a970cfd9ac319870156f100e93eb1d4b437

Contents?: true

Size: 626 Bytes

Versions: 13

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

module Handlebarsjs
  # Configuration data such has helpers for handlebarsjs
  class HandlebarsConfiguration
    include KLog::Logging

    attr_accessor :helpers
    attr_reader :defaults

    def initialize
      @helpers = []
      @defaults = Handlebarsjs::HandlebarsConfigurationDefaults.new
    end

    HelperConfig = Struct.new(:name, :helper)

    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
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
handlebarsjs-0.14.2 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.14.1 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.14.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.13.1 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.13.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.12.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.11.3 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.11.2 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.11.1 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.11.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.10.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.9.0 lib/handlebarsjs/handlebars_configuration.rb
handlebarsjs-0.8.0 lib/handlebarsjs/handlebars_configuration.rb