Class: FeduxOrgStdlib::List
- Inherits:
-
Object
- Object
- FeduxOrgStdlib::List
- Defined in:
- lib/fedux_org_stdlib/list.rb
Overview
A list
Instance Method Summary collapse
-
#initialize(*data) ⇒ List
constructor
A new instance of List.
-
#to_a ⇒ Array
Data as array.
-
#to_s(**options) ⇒ Object
Render data to table.
Constructor Details
#initialize(*data) ⇒ List
Returns a new instance of List.
30 31 32 |
# File 'lib/fedux_org_stdlib/list.rb', line 30 def initialize(*data) @data = data.flatten.map { |e| Hash(e) } end |
Instance Method Details
#to_a ⇒ Array
Data as array
46 47 48 |
# File 'lib/fedux_org_stdlib/list.rb', line 46 def to_a Array(data) end |
#to_s(**options) ⇒ Object
Render data to table
38 39 40 |
# File 'lib/fedux_org_stdlib/list.rb', line 38 def to_s(**) Hirb::Helpers::Table.render data, header_filter: proc(&:humanize), ** end |