class RgGen::Core::Builder::SimpleFeatureEntry

Attributes

name[R]
registry[R]

Public Class Methods

new(registry, name) click to toggle source
# File lib/rggen/core/builder/simple_feature_entry.rb, line 7
def initialize(registry, name)
  @registry = registry
  @name = name
end

Public Instance Methods

build_factory(_enabled_features) click to toggle source
# File lib/rggen/core/builder/simple_feature_entry.rb, line 24
def build_factory(_enabled_features)
  @factory.new(@name) { |f| f.target_feature(@feature) }
end
match_entry_type?(entry_type) click to toggle source
# File lib/rggen/core/builder/simple_feature_entry.rb, line 20
def match_entry_type?(entry_type)
  entry_type == :simple
end
setup(base_feature, factory, context, &body) click to toggle source
# File lib/rggen/core/builder/simple_feature_entry.rb, line 15
def setup(base_feature, factory, context, &body)
  @feature = define_feature(base_feature, context, &body)
  @factory = factory
end

Private Instance Methods

define_feature(base, context, &body) click to toggle source
# File lib/rggen/core/builder/simple_feature_entry.rb, line 30
def define_feature(base, context, &body)
  feature = Class.new(base)
  context && feature.attach_context(context)
  block_given? && feature.class_exec(@name, &body)
  feature
end