Class: Bootstrap::ViewHelpers::Components::Badge

Inherits:
Bootstrap::ViewHelpers::Component show all
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

Methods inherited from Bootstrap::ViewHelpers::Component

#initialize

Constructor Details

This class inherits a constructor from Bootstrap::ViewHelpers::Component

Instance Method Details

#fade?Boolean

Defaults to true

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/bootstrap/view_helpers/components/badge.rb', line 12

def fade?
  return true if options[:fade].nil?
  options[:fade]
end

#to_htmlObject



7
8
9
# File 'lib/bootstrap/view_helpers/components/badge.rb', line 7

def to_html
  (:span, options) { options[:label] || block.call }
end