Class: UiBibz::Ui::Core::Glyph

Inherits:
Component show all
Defined in:
lib/ui_bibz/ui/core/glyph.rb

Overview

Create a glyph

This element is an extend of UiBibz::Ui::Core::Component.

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:

  • name - String

  • size - Integer

  • type - Symbol

  • state - Symbol (:default, :primary, :info, :warning, :danger)

Signatures

UiBibz::Ui::Core::Glyph.new content = nil, options = nil, html_options = nil,
&block

UiBibz::Ui::Core::Glyph.new(options = nil, html_options = nil) do
  content
end

UiBibz::Ui::Core::Glyph.new content = {}

UiBibz::Ui::Core::Glyph.new content, options = {}, html_options = {}

Exemples

UiBibz::Ui::Core::Glyph.new('eye').render

UiBibz::Ui::Core::Glyph.new() do
  name
end.render

UiBibz::Ui::Core::Glyph.new('eye', { size: 3, type: 'fw' }).render

UiBibz::Ui::Core::Glyph.new({ name: 'eye', size: 3, type: 'fw' }).render

Helper

glyph(options = {})

glyph(name, options = {}, html_options = {})

glyph(options = {}, html_options = {}) do
  name
end

Instance Attribute Summary

Attributes inherited from Component

#html_options, #options

Attributes inherited from Base

#output_buffer

Instance Method Summary (collapse)

Methods inherited from Component

#add_classes, #badge_html, #class_and_html_options, #glyph, #glyph_and_content_html, #glyph_with_space

Methods inherited from Base

#i18n_set?

Constructor Details

- (Glyph) initialize(content, options = nil, html_options = nil, &block)

See UiBibz::Ui::Core::Component.initialize



60
61
62
# File 'lib/ui_bibz/ui/core/glyph.rb', line 60

def initialize content, options = nil, html_options = nil, &block
  super
end

Instance Method Details

- (Object) render

Render html tag



65
66
67
# File 'lib/ui_bibz/ui/core/glyph.rb', line 65

def render
   :i, '', class_and_html_options(classes)
end