class UiBibz::Ui::Core::Layouts::Col

Create a col

This element is an extend of UiBibz::Ui::Core::Component. size are xs, sm, md, lg, xl

Attributes

Options

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

Signatures

UiBibz::Ui::Core::Layouts::Col.new(content, options = {}, html_options = {}).render

UiBibz::Ui::Core::Layouts::Col.new(options = {}, html_options = {}) do
  content
end.render

Examples

UiBibz::Ui::Core::Layouts::Col.new('content', { num: 2, offset: 1 }, { class: 'test' })

UiBibz::Ui::Core::Layouts::Col.new(xs: { num: 2, pull: 1, push: 1}, md: { num: 3 }, { class: 'test' }) do
  #content
end

Helper

col(options = {}, html_options = {}) do
 # content
end

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/layouts/col.rb, line 54
def initialize(content = nil, options = nil, html_options = nil, &block)
  content = { num: content } if !block.nil? && content.is_a?(Integer)
  super
end

Public Instance Methods

pre_render() click to toggle source

Render html tag

# File lib/ui_bibz/ui/core/layouts/col.rb, line 60
def pre_render
  content_tag :div, content, html_options
end

Private Instance Methods

component_html_classes() click to toggle source
# File lib/ui_bibz/ui/core/layouts/col.rb, line 66
def component_html_classes
  UiBibz::Utils::BreakdownClassNameGenerator.new(@options).class_names
end