class Voom::Presenters::DSL::Components::UnorderedList::ListItem
Public Class Methods
new(**attribs_, &block)
click to toggle source
Calls superclass method
Voom::Presenters::DSL::Components::Base::new
# File lib/voom/presenters/dsl/components/unordered_list.rb, line 22 def initialize(**attribs_, &block) super(type: :list_item, **attribs_, &block) self.text(attribs.delete(:text)) if attribs.key?(:text) self.icon(attribs.delete(:icon)) if attribs.key?(:icon) self.unordered_list(attribs.delete(:unordered_list)) if attribs.key?(:unordered_list) expand! end
Public Instance Methods
icon(icon=nil, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/unordered_list.rb, line 35 def icon(icon=nil, **attribs, &block) return @icon if locked? @icon = Components::Icon.new(parent: self, icon: icon, **attribs, &block) end
text(*text, **attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/unordered_list.rb, line 30 def text(*text, **attribs, &block) return @text if locked? @text = Components::Typography.new(parent: self, type: :text, text: text, **attribs, &block) end
unordered_list(**attribs, &block)
click to toggle source
# File lib/voom/presenters/dsl/components/unordered_list.rb, line 40 def unordered_list(**attribs, &block) return @unordered_list if locked? @unordered_list = UnorderedList.new(parent: self, **attribs, &block) end