Sha256: b3b11a2bdcf4933717d38d2ea386a2fac32861ae69953b6fad4a2b6a337f5d6d
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
# frozen_string_literal: true module Playbook module Pb<%= @kit_name_pascal %> class <%= @kit_name_pascal %> < Playbook::PbKit::Base PROPS = %i[<%= @kit_props.map{|key,val| "configured_#{key.parameterize.underscore}".to_sym }.join("\n\t\t\t\t\t") %>].freeze def initialize(<%= @kit_class_init.join(",\n\t\t\t\t\t\t\t") %>) <%= @kit_class_val.join("\n\t\t\t\t") %> end <% @unique_props.each do |key, val| %> def <%= key.to_s.underscore %><% case val %><% when "enum", "one_of" %> <%= key.to_s.underscore %>_options = %w(option1 option2) one_of_value(configured_<%= key.to_s.underscore %>, <%= key.to_s.underscore %>_options, "")<% when "boolean", "bool" %> true_value(configured_<%= key.to_s.underscore %>, "true value", "false value")<% else %> default_value(configured_<%= key.to_s.underscore %>, "")<% end %> end <% end %> def to_partial_path "<%= "pb_#{@kit_name_underscore}/#{@kit_name_underscore}" %>" end private DEFAULT = Object.new private_constant :DEFAULT def default_configuration DEFAULT end attr_accessor(*PROPS) end end end
Version data entries
4 entries across 4 versions & 1 rubygems