Sha256: b3a8d040240f7e15f45427d953551be80551ec2e1ac3f80b2defcc8a8aac958f
Contents?: true
Size: 1.25 KB
Versions: 24
Compression:
Stored size: 1.25 KB
Contents
# frozen_string_literal: true puts 'xxxxxxx' class HandlebarsHelperBuilder < KDirector::Builders::ActionsBuilder attr_reader :current_helper # attr_accessor :actions # attr_accessor :last_action def initialize super dom[:helpers] = [] # @actions = [] # @last_action = {} end def helpers dom[:helpers] end def add_helper @current_helper = new_helper dom[:helpers] << current_helper end def helper_setting(name, value) @current_helper[name] = value end def add_helper_parameter(name, description, splat: false) parameter = { name: name, description: description, splat: splat } @current_helper[:parameters] << parameter end def add_helper_example(value) lines = value.split("\n") value = lines.map { |line| " # #{line.strip}" }.join("\n") @current_helper[:examples] << value end private def new_helper { name: nil, description: nil, result: nil, category: nil, category_description: nil, base_class_require: nil, base_class: nil, example_input_value: nil, example_output_value: nil, test_input_value: nil, test_output_value: nil, parameters: [], examples: [] } end end
Version data entries
24 entries across 24 versions & 1 rubygems