Class: Bootstrap::ViewHelpers::Components::Badge
- Inherits:
-
Bootstrap::ViewHelpers::Component
- Object
- Bootstrap::ViewHelpers::Component
- Bootstrap::ViewHelpers::Components::Badge
- Defined in:
- lib/bootstrap/view_helpers/components/badge.rb
Instance Attribute Summary
Attributes inherited from Bootstrap::ViewHelpers::Component
#block, #options, #style, #view
Instance Method Summary collapse
-
#fade? ⇒ Boolean
Defaults to true.
- #to_html ⇒ Object
Methods inherited from Bootstrap::ViewHelpers::Component
Constructor Details
This class inherits a constructor from Bootstrap::ViewHelpers::Component
Instance Method Details
#fade? ⇒ Boolean
Defaults to true
12 13 14 15 |
# File 'lib/bootstrap/view_helpers/components/badge.rb', line 12 def fade? return true if [:fade].nil? [:fade] end |
#to_html ⇒ Object
7 8 9 |
# File 'lib/bootstrap/view_helpers/components/badge.rb', line 7 def to_html content_tag(:span, ) { [:label] || block.call } end |