Class: Validb::Counter
- Inherits:
-
Object
- Object
- Validb::Counter
- Defined in:
- lib/validb/counter.rb
Instance Method Summary collapse
- #count ⇒ Object
-
#initialize(model_names) ⇒ Counter
constructor
A new instance of Counter.
Constructor Details
#initialize(model_names) ⇒ Counter
Returns a new instance of Counter.
3 4 5 |
# File 'lib/validb/counter.rb', line 3 def initialize(model_names) @models = model_names.map(&:constantize) end |
Instance Method Details
#count ⇒ Object
7 8 9 10 11 12 |
# File 'lib/validb/counter.rb', line 7 def count $stdout.puts("\nChecking models:") @models.each do |model| $stdout.puts("#{model}(#{model.table_name}) (#{model.count} records)") end end |