Class: RgGen::Core::Base::Feature
- Extended by:
- Forwardable, 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 SharedContext
Constructor Details
#initialize(feature_name, sub_feature_name, component) ⇒ Feature
Returns a new instance of Feature.
11 12 13 14 15 16 17 |
# File 'lib/rggen/core/base/feature.rb', line 11 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.
35 36 37 |
# File 'lib/rggen/core/base/feature.rb', line 35 def printables @printables end |
Instance Attribute Details
#component ⇒ Object (readonly)
Returns the value of attribute component.
19 20 21 |
# File 'lib/rggen/core/base/feature.rb', line 19 def component @component end |
Instance Method Details
#feature_name(verbose: false) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/rggen/core/base/feature.rb', line 21 def feature_name(verbose: false) if verbose [@feature_name, @sub_feature_name] .compact.reject(&:empty?).join(':') else @feature_name end end |
#inspect ⇒ Object
30 31 32 |
# File 'lib/rggen/core/base/feature.rb', line 30 def inspect "#{feature_name(verbose: true)}(#{component})" end |