Sha256: 96a04f56a74c3e45ca11470276227b75aa44496271c7f67505ee670bbfbb3fd1
Contents?: true
Size: 1.33 KB
Versions: 6
Compression:
Stored size: 1.33 KB
Contents
# frozen_string_literal: true module UiBibz::Ui::Core::Navigations # Create a NavbarText # # ==== 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: # * +position+ - Symbol # (+:right+, +:left+) # # ==== Signatures # # UiBibz::Ui::Core::Navigations::NavbarText.new(content, options = nil, html_options = nil) # # UiBibz::Ui::Core::Navigations::NavbarText.new(options = nil, html_options = nil) do # content # end # # ==== Examples # # UiBibz::Ui::Core::Navigations::NavbarText.new('Exemple).render # # UiBibz::Ui::Core::Navigations::NavbarText.new(position: :right) do # 'Exemple' # end.render # class NavbarText < UiBibz::Ui::Core::Component # See UiBibz::Ui::Core::Component.initialize def initialize(content = nil, options = nil, html_options = nil, &block) super end # Render html tag def pre_render content_tag :span, content, html_options end private def component_html_classes ['navbar-text', position] end def position "navbar-#{options[:position]}" unless options[:position].nil? end end end
Version data entries
6 entries across 6 versions & 1 rubygems