class NfgUi::Bootstrap::Components::CarouselItem

Bootstrap Carousel Slide / Carousel Item Component getbootstrap.com/docs/4.1/components/carousel/#slides-only

Public Instance Methods

caption() click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 11
def caption
  options.fetch(:caption, nil)
end
component_family() click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 15
def component_family
  :carousel
end
image() click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 19
def image
  options.fetch(:image, nil)
end
label() click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 23
def label
  options.fetch(:label, nil)
end
render() { |: body)| ... } click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 27
def render
  super do
    capture do
      concat(image_tag(image, class: 'd-block w-100')) if image
      if caption || label
        concat(NfgUi::Bootstrap::Components::CarouselCaption.new({ body: caption, label: label }, view_context).render)
      end
      concat(block_given? ? yield : body)
    end
  end
end

Private Instance Methods

non_html_attribute_options() click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_item.rb, line 41
def non_html_attribute_options
  super.push(:image,
             :caption,
             :label)
end