Class: Superset::Chart::Delete

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/chart/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 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_idObject (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

#performObject



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

#responseObject



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

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