Class: ElementComponent::Components::NavbarBrand
- Defined in:
- lib/element_component/components/navbar/brand.rb
Instance Attribute Summary
Attributes inherited from Element
#attributes, #contents, #element, #html
Instance Method Summary collapse
-
#initialize(href: "#", **attributes, &block) ⇒ NavbarBrand
constructor
A new instance of NavbarBrand.
Methods inherited from Element
#add_attribute, #add_attribute!, #add_content, #add_content!, #new_element, #remove_attribute, #remove_attribute_value, #render, #reset_attributes!, #reset_contents!
Constructor Details
#initialize(href: "#", **attributes, &block) ⇒ NavbarBrand
Returns a new instance of NavbarBrand.
6 7 8 9 10 11 12 |
# File 'lib/element_component/components/navbar/brand.rb', line 6 def initialize(href: "#", **attributes, &block) super("a", &block) add_attribute(class: "navbar-brand") add_attribute(href: href) add_attribute(attributes) unless attributes.empty? end |