Sha256: 0ca25e3639b2d6353566fe5e8234aeb7f6828b6916787cbda7783bb1b3c39561
Contents?: true
Size: 1.78 KB
Versions: 9
Compression:
Stored size: 1.78 KB
Contents
require 'ui_bibz/ui/core/cards/components/block/card_block_text' require 'ui_bibz/ui/core/cards/components/block/card_block_title' require 'ui_bibz/ui/core/cards/components/block/card_block_link' module UiBibz::Ui::Core::Cards # Create a card block # # ==== 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::Cards::CardBlock.new(content, options = nil, html_options = nil) # # UiBibz::Ui::Core::Cards::CardBlock.new(options = nil, html_options = nil) do # content # end # # ==== Examples # # UiBibz::Ui::Core::Cards::CardBlock.new.render # # UiBibz::Ui::Core::Cards::CardBlock.new do # 'Exemple' # end.render # class CardBlock < UiBibz::Ui::Core::Component # See UiBibz::Ui::Core::Component.initialize def initialize content = nil, options = nil, html_options = nil, &block super @items = [@content] end # Render html tag def render content_tag :div, @items.join.html_safe, html_options end def title content = nil, options = nil, html_options = nil, &block @items << CardBlockTitle.new(content, options, html_options, &block).render end def link content = nil, options = nil, html_options = nil, &block @items << CardBlockLink.new(content, options, html_options, &block).render end def text content = nil, options = nil, html_options = nil, &block @items << CardBlockText.new(content, options, html_options, &block).render end private def component_html_classes "card-block" end end end
Version data entries
9 entries across 9 versions & 1 rubygems