Class: ClassMetrix::Config::ExtractionConfig
- Inherits:
-
Object
- Object
- ClassMetrix::Config::ExtractionConfig
- Defined in:
- lib/class_metrix/config/extraction_config.rb
Overview
Centralized configuration for extraction behavior
Instance Attribute Summary collapse
-
#include_private ⇒ Object
readonly
Returns the value of attribute include_private.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #comprehensive ⇒ Object
- #comprehensive? ⇒ Boolean
- #include_inheritance? ⇒ Boolean
- #include_modules? ⇒ Boolean
- #include_private? ⇒ Boolean
-
#initialize(scope: :comprehensive, include_private: false, **options) ⇒ ExtractionConfig
constructor
A new instance of ExtractionConfig.
- #strict ⇒ Object
-
#strict? ⇒ Boolean
Scope strategies: :strict - Only the class itself (no inheritance/modules) :comprehensive - Class + inheritance + modules (default).
-
#to_extraction_options ⇒ Object
Convert to options hash for backward compatibility.
-
#with_private ⇒ Object
Create a new config with modified settings.
Constructor Details
#initialize(scope: :comprehensive, include_private: false, **options) ⇒ ExtractionConfig
Returns a new instance of ExtractionConfig.
9 10 11 12 13 |
# File 'lib/class_metrix/config/extraction_config.rb', line 9 def initialize(scope: :comprehensive, include_private: false, **) @scope = scope @include_private = include_private @options = end |
Instance Attribute Details
#include_private ⇒ Object (readonly)
Returns the value of attribute include_private.
7 8 9 |
# File 'lib/class_metrix/config/extraction_config.rb', line 7 def include_private @include_private end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/class_metrix/config/extraction_config.rb', line 7 def @options end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
7 8 9 |
# File 'lib/class_metrix/config/extraction_config.rb', line 7 def scope @scope end |
Instance Method Details
#comprehensive ⇒ Object
55 56 57 58 59 60 61 |
# File 'lib/class_metrix/config/extraction_config.rb', line 55 def comprehensive self.class.new( scope: :comprehensive, include_private: @include_private, **@options ) end |
#comprehensive? ⇒ Boolean
22 23 24 |
# File 'lib/class_metrix/config/extraction_config.rb', line 22 def comprehensive? @scope == :comprehensive end |
#include_inheritance? ⇒ Boolean
30 31 32 |
# File 'lib/class_metrix/config/extraction_config.rb', line 30 def include_inheritance? comprehensive? end |
#include_modules? ⇒ Boolean
34 35 36 |
# File 'lib/class_metrix/config/extraction_config.rb', line 34 def include_modules? comprehensive? end |
#include_private? ⇒ Boolean
26 27 28 |
# File 'lib/class_metrix/config/extraction_config.rb', line 26 def include_private? @include_private end |
#strict ⇒ Object
47 48 49 50 51 52 53 |
# File 'lib/class_metrix/config/extraction_config.rb', line 47 def strict self.class.new( scope: :strict, include_private: @include_private, **@options ) end |
#strict? ⇒ Boolean
Scope strategies: :strict - Only the class itself (no inheritance/modules) :comprehensive - Class + inheritance + modules (default)
18 19 20 |
# File 'lib/class_metrix/config/extraction_config.rb', line 18 def strict? @scope == :strict end |
#to_extraction_options ⇒ Object
Convert to options hash for backward compatibility
64 65 66 67 68 69 70 |
# File 'lib/class_metrix/config/extraction_config.rb', line 64 def { include_inherited: include_inheritance?, include_modules: include_modules?, include_private: include_private? }.merge(@options) end |
#with_private ⇒ Object
Create a new config with modified settings
39 40 41 42 43 44 45 |
# File 'lib/class_metrix/config/extraction_config.rb', line 39 def with_private self.class.new( scope: @scope, include_private: true, **@options ) end |