class UiBibz::Ui::Core::Boxes::CardGroup

Create a card group

Attributes

Options

You can add HTML attributes using the html_options. You can pass arguments in options attribute:

Signatures

UiBibz::Ui::Core::Boxes::CardGroup.new(content, options = nil, html_options = nil)

UiBibz::Ui::Core::Boxes::CardGroup.new(options = nil, html_options = nil) do
  cg.card content, options, html_options, &block
end

Examples

UiBibz::Ui::Core::Boxes::CardGroup.new do |cg|
  cg.card 'Exemple 1'
  cg.card 'Exemple 2'
  cg.card 'Exemple 3'
end.render

Public Class Methods

new(content = nil, options = nil, html_options = nil, &block) click to toggle source

See UiBibz::Ui::Core::Component.initialize

Calls superclass method UiBibz::Ui::Core::Component::new
# File lib/ui_bibz/ui/core/boxes/card_group.rb, line 37
def initialize(content = nil, options = nil, html_options = nil, &block)
  super
  @items = []
end

Public Instance Methods

card(content = nil, options = nil, html_options = nil, &block) click to toggle source
# File lib/ui_bibz/ui/core/boxes/card_group.rb, line 47
def card(content = nil, options = nil, html_options = nil, &block)
  @items << if tapped?(block)
              UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options).tap(&block).render
            else
              UiBibz::Ui::Core::Boxes::Card.new(content, options, html_options, &block).render
            end
end
pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/boxes/card_group.rb, line 43
def pre_render
  content_tag :div, @items.join.html_safe, html_options
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/boxes/card_group.rb, line 57
def component_html_classes
  'card-group'
end