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, #initialize, #match_entry_type?, #modify

Constructor Details

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

Instance Method Details

#define_factory(&body) ⇒ Object Also known as: factory



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

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

#define_feature(&body) ⇒ Object Also known as: feature



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

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

#setup(base_feature, base_factory, context, &body) ⇒ Object



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

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