Class: Superset::Chart::List
- Defined in:
- lib/superset/chart/list.rb
Constant Summary
Constants inherited from Request
Instance Attribute Summary collapse
-
#dashboard_id_eq ⇒ Object
readonly
Returns the value of attribute dashboard_id_eq.
-
#dataset_id_eq ⇒ Object
readonly
Returns the value of attribute dataset_id_eq.
-
#name_contains ⇒ Object
readonly
Returns the value of attribute name_contains.
Attributes inherited from Request
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(page_num: 0, name_contains: '', dashboard_id_eq: '', dataset_id_eq: '') ⇒ List
constructor
A new instance of List.
- #list_with_dashboards ⇒ Object
- #rows_with_dashboards ⇒ Object
Methods inherited from Request
#query_params, #response, #result, #superset_host
Methods included from Display
#display_headers, #headings, #list, #result, #rows, #table, #title
Constructor Details
#initialize(page_num: 0, name_contains: '', dashboard_id_eq: '', dataset_id_eq: '') ⇒ List
Returns a new instance of List.
7 8 9 10 11 12 |
# File 'lib/superset/chart/list.rb', line 7 def initialize(page_num: 0, name_contains: '', dashboard_id_eq: '', dataset_id_eq: '') @name_contains = name_contains @dashboard_id_eq = dashboard_id_eq @dataset_id_eq = dataset_id_eq super(page_num: page_num) end |
Instance Attribute Details
#dashboard_id_eq ⇒ Object (readonly)
Returns the value of attribute dashboard_id_eq.
5 6 7 |
# File 'lib/superset/chart/list.rb', line 5 def dashboard_id_eq @dashboard_id_eq end |
#dataset_id_eq ⇒ Object (readonly)
Returns the value of attribute dataset_id_eq.
5 6 7 |
# File 'lib/superset/chart/list.rb', line 5 def dataset_id_eq @dataset_id_eq end |
#name_contains ⇒ Object (readonly)
Returns the value of attribute name_contains.
5 6 7 |
# File 'lib/superset/chart/list.rb', line 5 def name_contains @name_contains end |
Class Method Details
.call ⇒ Object
14 15 16 |
# File 'lib/superset/chart/list.rb', line 14 def self.call self.new.list end |
Instance Method Details
#list_with_dashboards ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/superset/chart/list.rb', line 18 def list_with_dashboards puts Terminal::Table.new( title: title, headings: list_dashboard_attributes.map(&:to_s).map(&:humanize), rows: rows_with_dashboards ) end |
#rows_with_dashboards ⇒ Object
26 27 28 29 30 |
# File 'lib/superset/chart/list.rb', line 26 def rows_with_dashboards result.map do |d| list_dashboard_attributes.map { |la| d[la].to_s } end end |