Class: NfgUi::Bootstrap::Components::CarouselCaption
- Defined in:
- lib/nfg_ui/bootstrap/components/carousel_caption.rb
Overview
Bootstrap Carousel Caption Component getbootstrap.com/docs/4.1/components/carousel/#with-captions
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#body, #options, #view_context
Instance Method Summary collapse
Methods inherited from Base
#data, #href, #html_options, #id, #initialize, #style
Constructor Details
This class inherits a constructor from NfgUi::Bootstrap::Components::Base
Instance Method Details
#component_family ⇒ Object
9 10 11 |
# File 'lib/nfg_ui/bootstrap/components/carousel_caption.rb', line 9 def component_family :carousel end |
#label ⇒ Object
13 14 15 |
# File 'lib/nfg_ui/bootstrap/components/carousel_caption.rb', line 13 def label .fetch(:label, nil) end |
#render ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/nfg_ui/bootstrap/components/carousel_caption.rb', line 17 def render super do capture do concat(content_tag(:h5, label)) if label concat(block_given? ? yield : body) end end end |