Sha256: 5dec591523bc6829d4c6e3f1e05861059aa0690f2717d98b0574e795dd4979fa

Contents?: true

Size: 745 Bytes

Versions: 24

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

module Handlebarsjs
  module Helpers
    # {{helper.category_description}}
    module {{camel helper.category}}
      # {{helper.description}}
      class And < Handlebarsjs::BaseHelper
        # Parse
        #
{{#each helper.examples}}
        # @example
        #
{{.}}
{{/each}}
        #
{{#each helper.parameters}}
        # @param {{./name}} {{./description}}
{{/each}}
        # @return [String] {{helper.result}}
        def parse({{#each helper.parameters}}{{#if @first }}{{^}}, {{/if}}{{#if splat}}*{{/if}}{{./name}}{{/each}})
          values.all? { |value| value }
        end

        def to_proc
          ->(*values, _opts) { wrapper(parse(values[0..-2])) }
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
handlebarsjs-0.14.2 .builders/.templates/helper.rb
handlebarsjs-0.14.1 .builders/.templates/helper.rb
handlebarsjs-0.14.0 .builders/.templates/helper.rb
handlebarsjs-0.13.1 .builders/.templates/helper.rb
handlebarsjs-0.13.0 .builders/.templates/helper.rb
handlebarsjs-0.12.0 .builders/.templates/helper.rb
handlebarsjs-0.11.3 .builders/.templates/helper.rb
handlebarsjs-0.11.2 .builders/.templates/helper.rb
handlebarsjs-0.11.1 .builders/.templates/helper.rb
handlebarsjs-0.11.0 .builders/.templates/helper.rb
handlebarsjs-0.10.0 .builders/.templates/helper.rb
handlebarsjs-0.9.0 .builders/.templates/helper.rb
handlebarsjs-0.8.0 .builders/.templates/helper.rb
handlebarsjs-0.7.0 .builders/.templates/helper.rb
handlebarsjs-0.6.3 .builders/.templates/helper.rb
handlebarsjs-0.6.2 .builders/.templates/helper.rb
handlebarsjs-0.6.1 .builders/.templates/helper.rb
handlebarsjs-0.6.0 .builders/.templates/helper.rb
handlebarsjs-0.5.7 .builders/.templates/helper.rb
handlebarsjs-0.5.6 .builders/.templates/helper.rb