Class: Superset::Database::GetCatalogs

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/database/get_catalogs.rb

Constant Summary

Constants inherited from Request

Request::DEFAULT_PAGE_SIZE

Instance Attribute Summary collapse

Attributes inherited from Request

#page_num, #page_size

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Request

#query_params, #response, #result, #superset_host

Methods included from Superset::Display

#ids, #list, #list_attributes, #result, #rows, #table, #title, #to_h

Constructor Details

#initialize(id, include_system_catalogs: false) ⇒ GetCatalogs

Returns a new instance of GetCatalogs.



7
8
9
10
# File 'lib/superset/database/get_catalogs.rb', line 7

def initialize(id, include_system_catalogs: false)
  @id = id
  @include_system_catalogs = include_system_catalogs
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/superset/database/get_catalogs.rb', line 5

def id
  @id
end

#include_system_catalogsObject (readonly)

Returns the value of attribute include_system_catalogs.



5
6
7
# File 'lib/superset/database/get_catalogs.rb', line 5

def include_system_catalogs
  @include_system_catalogs
end

Class Method Details

.call(id) ⇒ Object



12
13
14
# File 'lib/superset/database/get_catalogs.rb', line 12

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

Instance Method Details

#catalogsObject



16
17
18
19
20
# File 'lib/superset/database/get_catalogs.rb', line 16

def catalogs
  return result if include_system_catalogs

  remove_system_catalogs
end