class RgGen::Core::Base::Feature

Attributes

printables[R]
component[R]

Public Class Methods

new(feature_name, sub_feature_name, component) { |self| ... } click to toggle source
# File lib/rggen/core/base/feature.rb, line 11
def initialize(feature_name, sub_feature_name, component)
  @feature_name = feature_name
  @sub_feature_name = sub_feature_name
  @component = component
  post_initialize
  block_given? && yield(self)
end

Private Class Methods

available?(&body) click to toggle source
# File lib/rggen/core/base/feature.rb, line 43
def available?(&body)
  define_method(:available?, &body)
end
define_helpers(&body) click to toggle source
# File lib/rggen/core/base/feature.rb, line 39
def define_helpers(&body)
  singleton_class.class_exec(&body)
end

Public Instance Methods

feature_name(verbose: false) click to toggle source
# File lib/rggen/core/base/feature.rb, line 21
def feature_name(verbose: false)
  if verbose
    [@feature_name, @sub_feature_name]
      .compact.reject(&:empty?).join(':')
  else
    @feature_name
  end
end
inspect() click to toggle source
# File lib/rggen/core/base/feature.rb, line 30
def inspect
  "#{feature_name(verbose: true)}(#{component})"
end

Private Instance Methods

helper() click to toggle source
# File lib/rggen/core/base/feature.rb, line 55
def helper
  self.class
end
post_initialize() click to toggle source
# File lib/rggen/core/base/feature.rb, line 52
def post_initialize
end