Class: ModelScope::Runner
- Inherits:
-
Object
- Object
- ModelScope::Runner
- Defined in:
- lib/modelscope/runner.rb
Constant Summary collapse
- DEFAULT_FORMAT =
:table
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(format:, model:, paths:, kind: :callbacks) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(format:, model:, paths:, kind: :callbacks) ⇒ Runner
Returns a new instance of Runner.
11 12 13 14 15 16 |
# File 'lib/modelscope/runner.rb', line 11 def initialize(format:, model:, paths:, kind: :callbacks) @format = (format || DEFAULT_FORMAT).to_sym @model_name = model @paths = paths @kind = kind end |
Class Method Details
.run(format: DEFAULT_FORMAT, model: nil, paths: nil, kind: :callbacks) ⇒ Object
7 8 9 |
# File 'lib/modelscope/runner.rb', line 7 def self.run(format: DEFAULT_FORMAT, model: nil, paths: nil, kind: :callbacks) new(format: format, model: model, paths: paths, kind: kind).run end |
Instance Method Details
#run ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/modelscope/runner.rb', line 18 def run if @kind == :report [:callbacks, :validations].map do |ckind| generate_report(collect_callbacks(ckind), ckind) end.join("\n\n") else generate_report(collect_callbacks(@kind), @kind) end end |