Class: KDomain::RailsCodeExtractor::ExtractModel
- Inherits:
-
Object
- Object
- KDomain::RailsCodeExtractor::ExtractModel
- Includes:
- KLog::Logging
- Defined in:
- lib/k_domain/rails_code_extractor/extract_model.rb
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#models ⇒ Object
readonly
Returns the value of attribute models.
-
#shims_loaded ⇒ Object
readonly
Returns the value of attribute shims_loaded.
Instance Method Summary collapse
- #extract(file) ⇒ Object
-
#initialize(load_shim) ⇒ ExtractModel
constructor
A new instance of ExtractModel.
Constructor Details
#initialize(load_shim) ⇒ ExtractModel
Returns a new instance of ExtractModel.
13 14 15 16 17 |
# File 'lib/k_domain/rails_code_extractor/extract_model.rb', line 13 def initialize(load_shim) @load_shim = load_shim @shims_loaded = false @models = [] end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
11 12 13 |
# File 'lib/k_domain/rails_code_extractor/extract_model.rb', line 11 def model @model end |
#models ⇒ Object (readonly)
Returns the value of attribute models.
10 11 12 |
# File 'lib/k_domain/rails_code_extractor/extract_model.rb', line 10 def models @models end |
#shims_loaded ⇒ Object (readonly)
Returns the value of attribute shims_loaded.
9 10 11 |
# File 'lib/k_domain/rails_code_extractor/extract_model.rb', line 9 def shims_loaded @shims_loaded end |
Instance Method Details
#extract(file) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/k_domain/rails_code_extractor/extract_model.rb', line 19 def extract(file) load_shims unless shims_loaded ActiveRecord.class_info = nil load_retry(file, 10, nil) rescue StandardError => e log.exception(e) end |