Sha256: 9cabdabe4bfc3e0741c5f2fca0c349e88682ec0020140c94ec9bc3b2c1bcb86a
Contents?: true
Size: 995 Bytes
Versions: 5
Compression:
Stored size: 995 Bytes
Contents
module Playbook module Pb<%=name.titleize%> class <%=name.titleize%> PROPS = [:configured_class, :configured_text].freeze def initialize(class_name: default_configuration, text: default_configuration) self.configured_class = class_name self.configured_text = text end def class_name if configured_class == default_configuration "" else configured_class end end def text if configured_text == default_configuration "I am a rails kit" else configured_text end end def to_partial_path "pb_<%=name%>/<%=name%>" end def self.options new_hash = PROPS.map { |e| e.to_s.remove("configured_") } end private DEFAULT = Object.new private_constant :DEFAULT def default_configuration DEFAULT end attr_accessor(*PROPS) end end end
Version data entries
5 entries across 5 versions & 1 rubygems