Class: Deadlyzer::ConstantLoader
- Inherits:
-
Object
- Object
- Deadlyzer::ConstantLoader
- Defined in:
- lib/deadlyzer/constant_loader.rb
Defined Under Namespace
Classes: Constant
Constant Summary collapse
- CURRENT_DIRECTORY =
File.('.', __dir__)
- DEFAULT_PATTERN =
'/**/*.rb'
Instance Attribute Summary collapse
- #ast ⇒ Object private
- #directory ⇒ Object readonly private
- #empty_files ⇒ Object readonly private
- #exclude ⇒ Object readonly private
- #excluded_consts ⇒ Object readonly private
- #excluded_dirs ⇒ Object readonly private
- #pattern ⇒ Object readonly private
Instance Method Summary collapse
- #constants ⇒ Object private
-
#initialize(directory: nil, excluded_dirs: nil, excluded_consts: nil, pattern: nil) ⇒ ConstantLoader
constructor
A new instance of ConstantLoader.
Constructor Details
#initialize(directory: nil, excluded_dirs: nil, excluded_consts: nil, pattern: nil) ⇒ ConstantLoader
Returns a new instance of ConstantLoader.
37 38 39 40 41 42 43 44 45 |
# File 'lib/deadlyzer/constant_loader.rb', line 37 def initialize(directory: nil, excluded_dirs: nil, excluded_consts: nil, pattern: nil) @directory = directory @excluded_dirs = excluded_dirs || [] @excluded_consts = excluded_consts || [] @pattern = pattern || DEFAULT_PATTERN @ast = [] @constants = [] @empty_files = [] end |
Instance Attribute Details
#ast ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
35 36 37 |
# File 'lib/deadlyzer/constant_loader.rb', line 35 def ast @ast end |
#directory ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/deadlyzer/constant_loader.rb', line 11 def directory @directory end |
#empty_files ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/deadlyzer/constant_loader.rb', line 19 def empty_files @empty_files end |
#exclude ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/deadlyzer/constant_loader.rb', line 27 def exclude @exclude end |
#excluded_consts ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/deadlyzer/constant_loader.rb', line 23 def excluded_consts @excluded_consts end |
#excluded_dirs ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/deadlyzer/constant_loader.rb', line 15 def excluded_dirs @excluded_dirs end |
#pattern ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
31 32 33 |
# File 'lib/deadlyzer/constant_loader.rb', line 31 def pattern @pattern end |
Instance Method Details
#constants ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 52 53 54 |
# File 'lib/deadlyzer/constant_loader.rb', line 49 def constants load_ast! load_matcher! load_constants! @constants end |