Class: Superset::Dashboard::Get

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/dashboard/get.rb

Constant Summary

Constants inherited from Request

Request::PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

#query_params, #response, #result, #superset_host

Methods included from Superset::Display

#display_headers, #list, #list_attributes, #result, #table

Constructor Details

#initialize(id) ⇒ Get

note .. this endpoint also accepts a dashboards uuid as the identifier



8
9
10
# File 'lib/superset/dashboard/get.rb', line 8

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/superset/dashboard/get.rb', line 5

def id
  @id
end

Class Method Details

.call(id) ⇒ Object



12
13
14
# File 'lib/superset/dashboard/get.rb', line 12

def self.call(id)
  self.new(id).list
end

Instance Method Details

#filter_configurationObject



29
30
31
# File 'lib/superset/dashboard/get.rb', line 29

def filter_configuration
  ['native_filter_configuration'] || []
end

#json_metadataObject



25
26
27
# File 'lib/superset/dashboard/get.rb', line 25

def 
  JSON.parse(result['json_metadata'])
end

#performObject



16
17
18
19
# File 'lib/superset/dashboard/get.rb', line 16

def perform
  response
  self
end

#positionsObject



33
34
35
# File 'lib/superset/dashboard/get.rb', line 33

def positions
  JSON.parse(result['position_json'])
end

#titleObject



21
22
23
# File 'lib/superset/dashboard/get.rb', line 21

def title
  "#{result['dashboard_title']}"
end

#urlObject



37
38
39
# File 'lib/superset/dashboard/get.rb', line 37

def url
  "#{superset_host}#{result['url']}"
end