class Bootstrap::ViewHelpers::Components::Badge
Public Instance Methods
fade?()
click to toggle source
Defaults to true
# File lib/bootstrap/view_helpers/components/badge.rb, line 12 def fade? return true if options[:fade].nil? options[:fade] end
to_html()
click to toggle source
# File lib/bootstrap/view_helpers/components/badge.rb, line 7 def to_html content_tag(:span, options) { options[:label] || block.call } end
Protected Instance Methods
inject_class_name()
click to toggle source
# File lib/bootstrap/view_helpers/components/badge.rb, line 24 def inject_class_name pill = options[:pill] ? 'badge-pill' : '' class_name = "badge badge-#{style} #{pill} " class_name << options[:class] if options[:class].present? options[:class] = class_name end
parse_options(opts)
click to toggle source
Calls superclass method
Bootstrap::ViewHelpers::Component#parse_options
# File lib/bootstrap/view_helpers/components/badge.rb, line 19 def parse_options(opts) super inject_class_name end