Class: ActiveRecordScanner::Scanner
- Inherits:
-
Object
- Object
- ActiveRecordScanner::Scanner
- Defined in:
- lib/active_record_scanner.rb
Instance Method Summary collapse
-
#initialize(glob, options = {}) ⇒ Scanner
constructor
A new instance of Scanner.
- #scan ⇒ Object
- #scan_file(raw) ⇒ Object
Constructor Details
#initialize(glob, options = {}) ⇒ Scanner
Returns a new instance of Scanner.
7 8 9 10 11 |
# File 'lib/active_record_scanner.rb', line 7 def initialize(glob, ={}) @glob = glob @options = @results = [] end |
Instance Method Details
#scan ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/active_record_scanner.rb', line 13 def scan Dir.glob(@glob).each do |file| print "." unless @options[:silent] @file = file raw = IO.binread(file) scan_file(raw) end @results end |