Sha256: 345371d43fe9c2bf54b52986c5c2f827a49d507b40b9d4061c08607c1bcb1c24
Contents?: true
Size: 1.54 KB
Versions: 13
Compression:
Stored size: 1.54 KB
Contents
# frozen_string_literal: true module UiBibz::Ui::Core::Boxes::Components # Create a card col # # ==== 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::CardCol.new(content, options = nil, html_options = nil) # # UiBibz::Ui::Core::Boxes::CardCol.new(options = nil, html_options = nil) do # content # end # # UiBibz::Ui::Core::Boxes::CardCol.new(options = nil, html_options = nil) do |col| # col.body do # content # end # end # # ==== Examples # # UiBibz::Ui::Core::Boxes::CardCol.new.render # # UiBibz::Ui::Core::Boxes::CardCol.new do # 'Exemple' # end.render # # UiBibz::Ui::Core::Boxes::CardCol.new do |col| # col.body do # 'Exemple' # end # end.render # class CardCol < UiBibz::Ui::Core::Layouts::Col include UiBibz::Ui::Concerns::CardItemableConcern # See UiBibz::Ui::Core::Component.initialize def initialize(content = nil, options = nil, html_options = nil, &block) content = { num: content } if content.is_a?(Integer) super @items = [@content] end def pre_render content_tag :div, html_structure, html_options end private def html_structure [@header, @items.join, @footer].compact.join.html_safe end end end
Version data entries
13 entries across 13 versions & 1 rubygems