Class: Superset::Dashboard::Put
- Defined in:
- lib/superset/dashboard/put.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#target_dashboard_id ⇒ Object
readonly
Returns the value of attribute target_dashboard_id.
Attributes inherited from Request
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(target_dashboard_id:, params:) ⇒ Put
constructor
A new instance of Put.
- #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(target_dashboard_id:, params:) ⇒ Put
Returns a new instance of Put.
10 11 12 13 |
# File 'lib/superset/dashboard/put.rb', line 10 def initialize(target_dashboard_id:, params:) @target_dashboard_id = target_dashboard_id @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/superset/dashboard/put.rb', line 8 def params @params end |
#target_dashboard_id ⇒ Object (readonly)
Returns the value of attribute target_dashboard_id.
8 9 10 |
# File 'lib/superset/dashboard/put.rb', line 8 def target_dashboard_id @target_dashboard_id end |
Instance Method Details
#id ⇒ Object
26 27 28 |
# File 'lib/superset/dashboard/put.rb', line 26 def id response["result"]["id"] end |
#perform ⇒ Object
15 16 17 18 19 20 |
# File 'lib/superset/dashboard/put.rb', line 15 def perform raise "Error: target_dashboard_id integer is required" unless target_dashboard_id.present? && target_dashboard_id.is_a?(Integer) raise "Error: params hash is required" unless params.present? && params.is_a?(Hash) response end |
#response ⇒ Object
22 23 24 |
# File 'lib/superset/dashboard/put.rb', line 22 def response @response ||= client.put(route, params) end |