Module: CassandraCleaner::CqlRspecNotifications::Client

Included in:
Cql::Client::AsynchronousClient, Cql::Client::SynchronousClient
Defined in:
lib/cassandra_cleaner/cql_rspec_notifications.rb

Instance Method Summary collapse

Instance Method Details

#execute_with_notify(*args) ⇒ Object



22
23
24
25
26
27
# File 'lib/cassandra_cleaner/cql_rspec_notifications.rb', line 22

def execute_with_notify(*args)
  res = execute_without_notify(*args)
  table_name = grap_table_name(args)
  notify_observers(table_name)
  res
end

#grap_table_name(args) ⇒ Object



29
30
31
# File 'lib/cassandra_cleaner/cql_rspec_notifications.rb', line 29

def grap_table_name(args)
  $1.split('.').last if args && args.first.match(/(?:INSERT INTO|UPDATE)\s([\w\.]*)\s.*/)        
end