Class: KDomain::RailsCodeExtractor::ShimLoader
- Inherits:
-
Object
- Object
- KDomain::RailsCodeExtractor::ShimLoader
- Includes:
- KLog::Logging
- Defined in:
- lib/k_domain/rails_code_extractor/shim_loader.rb
Instance Attribute Summary collapse
-
#shim_files ⇒ Object
readonly
Returns the value of attribute shim_files.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize ⇒ ShimLoader
constructor
A new instance of ShimLoader.
- #register(name, file) ⇒ Object
Constructor Details
#initialize ⇒ ShimLoader
Returns a new instance of ShimLoader.
16 17 18 |
# File 'lib/k_domain/rails_code_extractor/shim_loader.rb', line 16 def initialize @shim_files = [] end |
Instance Attribute Details
#shim_files ⇒ Object (readonly)
Returns the value of attribute shim_files.
14 15 16 |
# File 'lib/k_domain/rails_code_extractor/shim_loader.rb', line 14 def shim_files @shim_files end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 |
# File 'lib/k_domain/rails_code_extractor/shim_loader.rb', line 20 def call shim_files.select { |sf| sf[:exist] }.each do |sf| require sf[:file] end nil end |
#register(name, file) ⇒ Object
27 28 29 |
# File 'lib/k_domain/rails_code_extractor/shim_loader.rb', line 27 def register(name, file) @shim_files << { name: name, file: file, exist: File.exist?(file) } end |