mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-17 05:22:35 +00:00
Ran rubocop -a
This commit is contained in:
@@ -8,23 +8,19 @@ module CyberarmEngine
|
||||
type = File.basename(model_file).split(".").last.to_sym
|
||||
|
||||
if model = load_model_from_cache(type, model_file)
|
||||
return model
|
||||
model
|
||||
else
|
||||
model = CyberarmEngine::Model.new(file_path: model_file)
|
||||
cache_model(type, model_file, model)
|
||||
|
||||
return model
|
||||
model
|
||||
end
|
||||
end
|
||||
|
||||
def self.load_model_from_cache(type, model_file)
|
||||
if CACHE[type].is_a?(Hash)
|
||||
if CACHE[type][model_file]
|
||||
return CACHE[type][model_file]
|
||||
end
|
||||
end
|
||||
return CACHE[type][model_file] if CACHE[type].is_a?(Hash) && (CACHE[type][model_file])
|
||||
|
||||
return false
|
||||
false
|
||||
end
|
||||
|
||||
def self.cache_model(type, model_file, model)
|
||||
|
||||
Reference in New Issue
Block a user