Class: Selenium::DevTools::V128::Database
- Inherits:
-
Object
- Object
- Selenium::DevTools::V128::Database
- Defined in:
- lib/selenium/devtools/v128/database.rb
Constant Summary collapse
- EVENTS =
{ add_database: 'addDatabase', }.freeze
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
- #execute_sql(database_id:, query:) ⇒ Object
- #get_database_table_names(database_id:) ⇒ Object
-
#initialize(devtools) ⇒ Database
constructor
A new instance of Database.
- #on(event, &block) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ Database
Returns a new instance of Database.
29 30 31 |
# File 'lib/selenium/devtools/v128/database.rb', line 29 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#disable ⇒ Object
38 39 40 |
# File 'lib/selenium/devtools/v128/database.rb', line 38 def disable @devtools.send_cmd('Database.disable') end |
#enable ⇒ Object
42 43 44 |
# File 'lib/selenium/devtools/v128/database.rb', line 42 def enable @devtools.send_cmd('Database.enable') end |
#execute_sql(database_id:, query:) ⇒ Object
46 47 48 49 50 |
# File 'lib/selenium/devtools/v128/database.rb', line 46 def execute_sql(database_id:, query:) @devtools.send_cmd('Database.executeSQL', databaseId: database_id, query: query) end |
#get_database_table_names(database_id:) ⇒ Object
52 53 54 55 |
# File 'lib/selenium/devtools/v128/database.rb', line 52 def get_database_table_names(database_id:) @devtools.send_cmd('Database.getDatabaseTableNames', databaseId: database_id) end |
#on(event, &block) ⇒ Object
33 34 35 36 |
# File 'lib/selenium/devtools/v128/database.rb', line 33 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Database.#{event}"] << block end |