class Bootstrap4RailsComponents::Bootstrap::Components::Carousel
Bootstrap
Carousel
Component getbootstrap.com/docs/4.1/components/carousel/
Public Instance Methods
component_family()
click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 9 def component_family :carousel end
controls()
click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 13 def controls options.fetch(:controls, false) end
data()
click to toggle source
Calls superclass method
Bootstrap4RailsComponents::Bootstrap::Components::Base#data
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 17 def data super.merge!(ride: 'carousel') end
indicators()
click to toggle source
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 21 def indicators options[:indicators] || 0 # return 0 on nil end
render() { |: body)| ... }
click to toggle source
Calls superclass method
Bootstrap4RailsComponents::Bootstrap::Components::Base#render
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 25 def render super do capture do content_tag(:div, class: 'carousel-inner') do if indicators > 0 concat(Bootstrap4RailsComponents::Bootstrap::Components::CarouselIndicators.new({ count: indicators, carousel: "##{id}" }, view_context).render) end concat(block_given? ? yield : body) if controls concat(Bootstrap4RailsComponents::Bootstrap::Components::CarouselControl.new({ control: :next, carousel: "##{id}" }, view_context).render) concat(Bootstrap4RailsComponents::Bootstrap::Components::CarouselControl.new({ control: :prev, carousel: "##{id}" }, view_context).render) end end end end end
Private Instance Methods
css_classes()
click to toggle source
Calls superclass method
Bootstrap4RailsComponents::Bootstrap::Components::Base#css_classes
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 44 def css_classes [ super, 'slide' ].join(' ').squish end
non_html_attribute_options()
click to toggle source
Calls superclass method
Bootstrap4RailsComponents::Bootstrap::Components::Base#non_html_attribute_options
# File lib/bootstrap4_rails_components/bootstrap/components/carousel.rb, line 51 def non_html_attribute_options super.push(:indicators, :controls) end