Class: Superset::Dashboard::Embedded::Get
- Inherits:
-
Request
- Object
- Request
- Superset::Dashboard::Embedded::Get
show all
- Defined in:
- lib/superset/dashboard/embedded/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, #superset_host
#display_headers, #headings, #rows, #table
Constructor Details
#initialize(id) ⇒ Get
Returns a new instance of Get.
11
12
13
|
# File 'lib/superset/dashboard/embedded/get.rb', line 11
def initialize(id)
@id = id
end
|
Instance Attribute Details
#id ⇒ Object
5
6
7
|
# File 'lib/superset/dashboard/embedded/get.rb', line 5
def id
@id
end
|
Class Method Details
.call(id) ⇒ Object
7
8
9
|
# File 'lib/superset/dashboard/embedded/get.rb', line 7
def self.call(id)
self.new(id).list
end
|
Instance Method Details
#allowed_domains ⇒ Object
27
28
29
|
# File 'lib/superset/dashboard/embedded/get.rb', line 27
def allowed_domains
result.first['allowed_domains'] unless response[:result].empty?
end
|
#list ⇒ Object
35
36
37
|
# File 'lib/superset/dashboard/embedded/get.rb', line 35
def list
super unless response[:result].empty?
end
|
#response ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/superset/dashboard/embedded/get.rb', line 15
def response
@response ||= client.get(route)
rescue Happi::Error::NotFound => e
logger.info("Dashboard #{id} has no Embedded settings. (skipping)") @response = { result: [] }.with_indifferent_access
@response
end
|
#result ⇒ Object
23
24
25
|
# File 'lib/superset/dashboard/embedded/get.rb', line 23
def result
response[:result].empty? ? [] : [ super ] end
|
#uuid ⇒ Object
31
32
33
|
# File 'lib/superset/dashboard/embedded/get.rb', line 31
def uuid
result.first['uuid'] unless response[:result].empty?
end
|