Class: DatabaseStalker::Parser
- Inherits:
-
Object
- Object
- DatabaseStalker::Parser
- Defined in:
- lib/database_stalker/parser.rb
Instance Method Summary collapse
-
#initialize(log) ⇒ Parser
constructor
A new instance of Parser.
- #table_names ⇒ Object
Constructor Details
#initialize(log) ⇒ Parser
Returns a new instance of Parser.
2 3 4 |
# File 'lib/database_stalker/parser.rb', line 2 def initialize(log) @log = log end |
Instance Method Details
#table_names ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/database_stalker/parser.rb', line 6 def table_names tables = [] @log.each do |line| matched = line.match(/INSERT\ INTO\ `(.+)` \(/) tables << matched[1] unless matched.nil? end tables.uniq end |