Class: FeduxOrgStdlib::List
- Inherits:
-
Object
- Object
- FeduxOrgStdlib::List
- Defined in:
- lib/fedux_org_stdlib/list.rb
Instance Method Summary collapse
-
#initialize(*data) ⇒ List
constructor
A new instance of List.
-
#to_a ⇒ Object
Data as array.
-
#to_s(**options) ⇒ Object
Render data to table.
Constructor Details
#initialize(*data) ⇒ List
Returns a new instance of List.
13 14 15 |
# File 'lib/fedux_org_stdlib/list.rb', line 13 def initialize(*data) @data = data.flatten.map { |e| Hash(e) } end |
Instance Method Details
#to_a ⇒ Object
Data as array
23 24 25 |
# File 'lib/fedux_org_stdlib/list.rb', line 23 def to_a Array(data) end |
#to_s(**options) ⇒ Object
Render data to table
18 19 20 |
# File 'lib/fedux_org_stdlib/list.rb', line 18 def to_s(**) Hirb::Helpers::Table.render data, header_filter: proc { |h| h.humanize }, ** end |