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