Class: Superset::Chart::BulkDelete
- Defined in:
- lib/superset/chart/bulk_delete.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#chart_ids ⇒ Object
readonly
Returns the value of attribute chart_ids.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(chart_ids: []) ⇒ BulkDelete
constructor
A new instance of BulkDelete.
- #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_ids: []) ⇒ BulkDelete
Returns a new instance of BulkDelete.
13 14 15 |
# File 'lib/superset/chart/bulk_delete.rb', line 13 def initialize(chart_ids: []) @chart_ids = chart_ids end |
Instance Attribute Details
#chart_ids ⇒ Object (readonly)
Returns the value of attribute chart_ids.
11 12 13 |
# File 'lib/superset/chart/bulk_delete.rb', line 11 def chart_ids @chart_ids end |
Instance Method Details
#perform ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/superset/chart/bulk_delete.rb', line 17 def perform raise InvalidParameterError, "chart_ids array of integers expected" unless chart_ids.is_a?(Array) raise InvalidParameterError, "chart_ids array must contain Integer only values" unless chart_ids.all? { |item| item.is_a?(Integer) } logger.info("Attempting to delete charts with id: #{chart_ids.join(', ')}") response end |
#response ⇒ Object
25 26 27 |
# File 'lib/superset/chart/bulk_delete.rb', line 25 def response @response ||= client.delete(route, params) end |