class RgGen::Core::Base::FeatureFactory
Public Class Methods
new(feature_name) { |self| ... }
click to toggle source
# File lib/rggen/core/base/feature_factory.rb, line 9 def initialize(feature_name) @feature_name = feature_name block_given? && yield(self) end
Public Instance Methods
create_feature(component, *args) { |feature| ... }
click to toggle source
# File lib/rggen/core/base/feature_factory.rb, line 17 def create_feature(component, *args) klass, sub_feature_name = select_feature(*args) klass.new(@feature_name, sub_feature_name, component) do |feature| feature.available? || break block_given? && yield(feature) component.add_feature(feature) end end
Private Instance Methods
select_feature(*args)
click to toggle source
# File lib/rggen/core/base/feature_factory.rb, line 28 def select_feature(*args) key = @target_features && target_feature_key(*args) feature = (key && @target_features[key]) || @target_feature [feature, key] end
target_feature_key(*args)
click to toggle source
# File lib/rggen/core/base/feature_factory.rb, line 34 def target_feature_key(*args) end