Class: RgGen::Core::Builder::GeneralFeatureEntry

Inherits:
FeatureEntryBase show all
Includes:
RgGen::Core::Base::SharedContext
Defined in:
lib/rggen/core/builder/general_feature_entry.rb

Instance Attribute Summary

Attributes inherited from FeatureEntryBase

#name, #registry

Instance Method Summary collapse

Methods included from RgGen::Core::Base::SharedContext

#attach_context

Methods inherited from FeatureEntryBase

#build_factory, #eval_bodies, #initialize, #match_entry_type?

Constructor Details

This class inherits a constructor from RgGen::Core::Builder::FeatureEntryBase

Instance Method Details

#define_factoryObject Also known as: factory



15
16
17
# File 'lib/rggen/core/builder/general_feature_entry.rb', line 15

def define_factory(&)
  @factory.class_exec(&)
end

#define_featureObject Also known as: feature



21
22
23
# File 'lib/rggen/core/builder/general_feature_entry.rb', line 21

def define_feature(&)
  @feature.class_exec(&)
end

#setup(base_feature, base_factory, context) ⇒ Object



9
10
11
12
13
# File 'lib/rggen/core/builder/general_feature_entry.rb', line 9

def setup(base_feature, base_factory, context)
  @feature = Class.new(base_feature)
  @factory = Class.new(base_factory)
  attach_shared_context(context, @feature, @factory, self)
end