Class: Superset::Dataset::BulkDelete
- Defined in:
- lib/superset/dataset/bulk_delete.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#dataset_ids ⇒ Object
readonly
Returns the value of attribute dataset_ids.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dataset_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 Superset::Display
#display_headers, #headings, #list, #list_attributes, #result, #rows, #table, #title
Constructor Details
#initialize(dataset_ids: []) ⇒ BulkDelete
Returns a new instance of BulkDelete.
14 15 16 |
# File 'lib/superset/dataset/bulk_delete.rb', line 14 def initialize(dataset_ids: []) @dataset_ids = dataset_ids end |
Instance Attribute Details
#dataset_ids ⇒ Object (readonly)
Returns the value of attribute dataset_ids.
12 13 14 |
# File 'lib/superset/dataset/bulk_delete.rb', line 12 def dataset_ids @dataset_ids end |
Instance Method Details
#perform ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/superset/dataset/bulk_delete.rb', line 18 def perform raise InvalidParameterError, "dataset_ids array of integers expected" unless dataset_ids.is_a?(Array) raise InvalidParameterError, "dataset_ids array must contain Integer only values" unless dataset_ids.all? { |item| item.is_a?(Integer) } logger.info("Attempting to delete datasets with id: #{dataset_ids.join(', ')}") response end |
#response ⇒ Object
26 27 28 |
# File 'lib/superset/dataset/bulk_delete.rb', line 26 def response @response ||= client.delete(route, params) end |