Class: Superset::Dataset::Get

Inherits:
Request
  • Object
show all
Defined in:
lib/superset/dataset/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

#headings, #list, #list_attributes, #result, #table

Constructor Details

#initialize(id) ⇒ Get

Returns a new instance of Get.



7
8
9
# File 'lib/superset/dataset/get.rb', line 7

def initialize(id)
  @id = id
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

Class Method Details

.call(id) ⇒ Object



11
12
13
# File 'lib/superset/dataset/get.rb', line 11

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

Instance Method Details

#performObject



15
16
17
18
# File 'lib/superset/dataset/get.rb', line 15

def perform
  response
  self
end

#rowsObject



20
21
22
# File 'lib/superset/dataset/get.rb', line 20

def rows
  [ [title, schema, database_name, database_id] ]
end

#schemaObject



24
25
26
# File 'lib/superset/dataset/get.rb', line 24

def schema
  result['schema']
end

#titleObject



28
29
30
# File 'lib/superset/dataset/get.rb', line 28

def title
  result['name']
end