class UiBibz::Ui::Core::Boxes::Components::CardCol

Create a card col

Attributes

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

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::Layouts::Col::new
# File lib/ui_bibz/ui/core/boxes/components/card_col.rb, line 49
def initialize(content = nil, options = nil, html_options = nil, &block)
  content = { num: content } if content.is_a?(Integer)
  super
  @items = [@content]
end

Public Instance Methods

pre_render() click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_col.rb, line 55
def pre_render
  content_tag :div, html_structure, html_options
end

Private Instance Methods

html_structure() click to toggle source
# File lib/ui_bibz/ui/core/boxes/components/card_col.rb, line 61
def html_structure
  [@header, @items.join, @footer].compact.join.html_safe
end