Class: RgGen::Core::Base::Feature
- Extended by:
- Forwardable, FeatureVariable, InternalStruct, SharedContext
- Defined in:
- lib/rggen/core/base/feature.rb
Direct Known Subclasses
Class Attribute Summary collapse
-
.printables ⇒ Object
readonly
Returns the value of attribute printables.
Instance Attribute Summary collapse
-
#component ⇒ Object
readonly
Returns the value of attribute component.
Instance Method Summary collapse
- #feature_name(verbose: false) ⇒ Object
-
#initialize(feature_name, sub_feature_name, component) ⇒ Feature
constructor
A new instance of Feature.
- #inspect ⇒ Object
Methods included from FeatureVariable
extended, feature_array_variable_get, feature_hash_array_variable_get, feature_hash_variable_fetch, feature_hash_variable_get, feaure_scala_variable_get
Methods included from SharedContext
Constructor Details
#initialize(feature_name, sub_feature_name, component) ⇒ Feature
Returns a new instance of Feature.
12 13 14 15 16 17 18 |
# File 'lib/rggen/core/base/feature.rb', line 12 def initialize(feature_name, sub_feature_name, component) @feature_name = feature_name @sub_feature_name = sub_feature_name @component = component post_initialize block_given? && yield(self) end |
Class Attribute Details
.printables ⇒ Object (readonly)
Returns the value of attribute printables.
36 37 38 |
# File 'lib/rggen/core/base/feature.rb', line 36 def printables @printables end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
20 21 22 |
# File 'lib/rggen/core/base/feature.rb', line 20 def component @component end |
Instance Method Details
#feature_name(verbose: false) ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/rggen/core/base/feature.rb', line 22 def feature_name(verbose: false) if verbose [@feature_name, @sub_feature_name] .compact.reject(&:empty?).join(':') else @feature_name end end |
#inspect ⇒ Object
31 32 33 |
# File 'lib/rggen/core/base/feature.rb', line 31 def inspect "#{feature_name(verbose: true)}(#{component})" end |