Class: Superset::Dashboard::Embedded::Put
- Defined in:
- lib/superset/dashboard/embedded/put.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#allowed_domains ⇒ Object
readonly
Returns the value of attribute allowed_domains.
-
#dashboard_id ⇒ Object
readonly
Returns the value of attribute dashboard_id.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(dashboard_id:, allowed_domains:) ⇒ Put
constructor
A new instance of Put.
- #params ⇒ Object
- #response ⇒ Object
- #uuid ⇒ 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(dashboard_id:, allowed_domains:) ⇒ Put
Returns a new instance of Put.
7 8 9 10 |
# File 'lib/superset/dashboard/embedded/put.rb', line 7 def initialize(dashboard_id: , allowed_domains: ) @dashboard_id = dashboard_id @allowed_domains = allowed_domains end |
Instance Attribute Details
#allowed_domains ⇒ Object (readonly)
Returns the value of attribute allowed_domains.
5 6 7 |
# File 'lib/superset/dashboard/embedded/put.rb', line 5 def allowed_domains @allowed_domains end |
#dashboard_id ⇒ Object (readonly)
Returns the value of attribute dashboard_id.
5 6 7 |
# File 'lib/superset/dashboard/embedded/put.rb', line 5 def dashboard_id @dashboard_id end |
Instance Method Details
#params ⇒ Object
19 20 21 |
# File 'lib/superset/dashboard/embedded/put.rb', line 19 def params { "allowed_domains": allowed_domains } end |
#response ⇒ Object
12 13 14 15 16 17 |
# File 'lib/superset/dashboard/embedded/put.rb', line 12 def response raise InvalidParameterError, 'dashboard_id integer is required' if dashboard_id.nil? || dashboard_id.class != Integer raise InvalidParameterError, 'allowed_domains array is required' if allowed_domains.nil? || allowed_domains.class != Array @response ||= client.put(route, params) end |
#uuid ⇒ Object
23 24 25 |
# File 'lib/superset/dashboard/embedded/put.rb', line 23 def uuid result['uuid'] unless response[:result].empty? end |