Class: Superset::Dataset::Delete

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/dataset/delete.rb

Constant Summary

Constants inherited from Request

Request::PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num

Instance Method Summary collapse

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_id:) ⇒ Delete

Returns a new instance of Delete.



8
9
10
# File 'lib/superset/dataset/delete.rb', line 8

def initialize(dataset_id: )
  @dataset_id = dataset_id
end

Instance Attribute Details

#dataset_idObject (readonly)

Returns the value of attribute dataset_id.



6
7
8
# File 'lib/superset/dataset/delete.rb', line 6

def dataset_id
  @dataset_id
end

Instance Method Details

#performObject



12
13
14
15
16
17
# File 'lib/superset/dataset/delete.rb', line 12

def perform
  raise InvalidParameterError, "dataset_id integer is required" unless dataset_id.present? && dataset_id.is_a?(Integer)

  logger.info("Attempting to delete dataset with id: #{dataset_id}")
  response
end

#responseObject



19
20
21
# File 'lib/superset/dataset/delete.rb', line 19

def response
  @response ||= client.delete(route)
end