Class: Annotato::ModelAnnotator
- Inherits:
-
Object
- Object
- Annotato::ModelAnnotator
- Defined in:
- lib/annotato/model_annotator.rb
Instance Method Summary collapse
-
#initialize(output: $stdout) ⇒ ModelAnnotator
constructor
A new instance of ModelAnnotator.
- #run(one_model = nil) ⇒ Object
Constructor Details
#initialize(output: $stdout) ⇒ ModelAnnotator
Returns a new instance of ModelAnnotator.
9 10 11 |
# File 'lib/annotato/model_annotator.rb', line 9 def initialize(output: $stdout) @output = output end |
Instance Method Details
#run(one_model = nil) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/annotato/model_annotator.rb', line 13 def run(one_model = nil) mtd = one_model ? [one_model] : models mtd.each do |model| next unless model.table_exists? annotation = AnnotationBuilder.build(model) write_annotation(model, annotation) end @output.puts "✅ Annotato completed" end |