Class: Typography::List
- Inherits:
-
Base
- Object
- Base
- Typography::List
- Defined in:
- lib/phlex_ui/typography/list.rb
Instance Method Summary collapse
-
#initialize(items: [], numbered: false, **attrs) ⇒ List
constructor
A new instance of List.
- #view_template ⇒ Object
Constructor Details
#initialize(items: [], numbered: false, **attrs) ⇒ List
Returns a new instance of List.
5 6 7 8 9 |
# File 'lib/phlex_ui/typography/list.rb', line 5 def initialize(items: [], numbered: false, **attrs) @items = items @numbered = numbered super(**attrs) end |
Instance Method Details
#view_template ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/phlex_ui/typography/list.rb', line 11 def view_template(&) if @items.empty? list(**attrs, &) else list(**attrs) do @items.each do |item| render PhlexUI::Typography::ListItem.new { item } end end end end |