Class: Superset::Dashboard::Delete
- Defined in:
- lib/superset/dashboard/delete.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#confirm_zero_charts ⇒ Object
readonly
Returns the value of attribute confirm_zero_charts.
-
#dashboard_id ⇒ Object
readonly
Returns the value of attribute dashboard_id.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dashboard_id:, confirm_zero_charts: true) ⇒ Delete
constructor
A new instance of Delete.
- #perform ⇒ Object
- #response ⇒ Object
Methods inherited from Request
call, #query_params, #result, #superset_host
Methods included from Superset::Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(dashboard_id:, confirm_zero_charts: true) ⇒ Delete
Returns a new instance of Delete.
9 10 11 12 |
# File 'lib/superset/dashboard/delete.rb', line 9 def initialize(dashboard_id: , confirm_zero_charts: true) @dashboard_id = dashboard_id @confirm_zero_charts = confirm_zero_charts end |
Instance Attribute Details
#confirm_zero_charts ⇒ Object (readonly)
Returns the value of attribute confirm_zero_charts.
7 8 9 |
# File 'lib/superset/dashboard/delete.rb', line 7 def confirm_zero_charts @confirm_zero_charts end |
#dashboard_id ⇒ Object (readonly)
Returns the value of attribute dashboard_id.
7 8 9 |
# File 'lib/superset/dashboard/delete.rb', line 7 def dashboard_id @dashboard_id end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/superset/dashboard/delete.rb', line 14 def perform raise InvalidParameterError, "dashboard_id integer is required" unless dashboard_id.present? && dashboard_id.is_a?(Integer) confirm_zero_charts_on_dashboard if confirm_zero_charts logger.info("Attempting to delete dashboard with id: #{dashboard_id}") response end |
#response ⇒ Object
23 24 25 |
# File 'lib/superset/dashboard/delete.rb', line 23 def response @response ||= client.delete(route) end |