Class: RgGen::Core::Builder::FeatureEntryBase

Inherits:
Object
  • Object
show all
Defined in:
lib/rggen/core/builder/feature_entry_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(registry, name) ⇒ FeatureEntryBase

Returns a new instance of FeatureEntryBase.



7
8
9
10
# File 'lib/rggen/core/builder/feature_entry_base.rb', line 7

def initialize(registry, name)
  @registry = registry
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/rggen/core/builder/feature_entry_base.rb', line 13

def name
  @name
end

#registryObject (readonly)

Returns the value of attribute registry.



12
13
14
# File 'lib/rggen/core/builder/feature_entry_base.rb', line 12

def registry
  @registry
end

Instance Method Details

#build_factory(targets) ⇒ Object



23
24
25
26
27
28
# File 'lib/rggen/core/builder/feature_entry_base.rb', line 23

def build_factory(targets)
  @factory.new(name) do |f|
    f.target_features(target_features(targets))
    f.target_feature(target_feature)
  end
end

#match_entry_type?(entry_type) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rggen/core/builder/feature_entry_base.rb', line 19

def match_entry_type?(entry_type)
  entry_type == entry_type_name
end

#modify(&body) ⇒ Object



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

def modify(&body)
  eval_body(&body)
end