class UiBibz::Ui::Core::Boxes::CardDeck
Create a card deck
Attributes¶ ↑
-
content
- Content of element -
options
- Options of element -
html_options
- Html Options of element
Options¶ ↑
You can add HTML attributes using the html_options
. You can pass arguments in options attribute:
Signatures¶ ↑
UiBibz::Ui::Core::Boxes::CardDeck.new(content, options = nil, html_options = nil) UiBibz::Ui::Core::Boxes::CardDeck.new(options = nil, html_options = nil) do cg.card content, options, html_options, &block end
Examples¶ ↑
UiBibz::Ui::Core::Boxes::CardDeck.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_deck.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_deck.rb, line 49 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_deck.rb, line 43 def pre_render content_tag :div, html_options do content_tag :div, @items.join.html_safe, class: 'card-deck' end end
Private Instance Methods
component_html_classes()
click to toggle source
# File lib/ui_bibz/ui/core/boxes/card_deck.rb, line 59 def component_html_classes 'card-deck-wrapper' end