Class: Superset::Services::DashboardLoader
- Inherits:
-
Object
- Object
- Superset::Services::DashboardLoader
- Includes:
- FileUtilities
- Defined in:
- lib/superset/services/dashboard_loader.rb
Defined Under Namespace
Classes: DashboardConfig
Constant Summary collapse
- TMP_PATH =
'/tmp/superset_dashboard_imports'.freeze
Instance Attribute Summary collapse
-
#dashboard_export_zip ⇒ Object
readonly
Returns the value of attribute dashboard_export_zip.
Instance Method Summary collapse
- #dashboard_config ⇒ Object
-
#initialize(dashboard_export_zip:) ⇒ DashboardLoader
constructor
A new instance of DashboardLoader.
- #perform ⇒ Object
Methods included from FileUtilities
Constructor Details
#initialize(dashboard_export_zip:) ⇒ DashboardLoader
Returns a new instance of DashboardLoader.
15 16 17 |
# File 'lib/superset/services/dashboard_loader.rb', line 15 def initialize(dashboard_export_zip:) @dashboard_export_zip = dashboard_export_zip end |
Instance Attribute Details
#dashboard_export_zip ⇒ Object (readonly)
Returns the value of attribute dashboard_export_zip.
13 14 15 |
# File 'lib/superset/services/dashboard_loader.rb', line 13 def dashboard_export_zip @dashboard_export_zip end |
Instance Method Details
#dashboard_config ⇒ Object
24 25 26 27 28 |
# File 'lib/superset/services/dashboard_loader.rb', line 24 def dashboard_config @dashboard_config ||= DashboardConfig.new( dashboard_export_zip: dashboard_export_zip, tmp_uniq_dashboard_path: tmp_uniq_dashboard_path).config end |
#perform ⇒ Object
19 20 21 22 |
# File 'lib/superset/services/dashboard_loader.rb', line 19 def perform unzip_source_file dashboard_config end |