Class: Superset::Chart::Create
- Defined in:
- lib/superset/chart/create.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Attributes inherited from Request
Instance Method Summary collapse
-
#initialize(params:) ⇒ Create
constructor
A new instance of Create.
- #perform ⇒ Object
- #response ⇒ Object
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(params:) ⇒ Create
Returns a new instance of Create.
18 19 20 |
# File 'lib/superset/chart/create.rb', line 18 def initialize(params: ) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
16 17 18 |
# File 'lib/superset/chart/create.rb', line 16 def params @params end |
Instance Method Details
#perform ⇒ Object
22 23 24 25 26 27 |
# File 'lib/superset/chart/create.rb', line 22 def perform raise "Error: params hash is required" unless params.present? && params.is_a?(Hash) logger.info("Creating New Chart") response['id'] end |
#response ⇒ Object
29 30 31 |
# File 'lib/superset/chart/create.rb', line 29 def response @response ||= client.post(route, params) end |