class NfgUi::Bootstrap::Components::CarouselControl
Bootstrap
Carousel
Control Component getbootstrap.com/docs/4.1/components/carousel/#with-controls
Public Instance Methods
body()
click to toggle source
CarouselControl
does not get adjustable body content
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 10 def body nil end
carousel()
click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 18 def carousel options.fetch(:carousel, nil) end
component_family()
click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 14 def component_family :carousel end
control()
click to toggle source
Options for control are :prev and :next control's value sets up the rest of the carousel control attributes in HTML
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 24 def control options.fetch(:control, nil) end
data()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::Base#data
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 28 def data control ? super.merge!(slide: control) : super end
href()
click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 32 def href carousel ? carousel : '#' end
icon_html_options()
click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 36 def icon_html_options return {} unless control { class: "carousel-control-#{control}-icon", aria: { hidden: true } } end
render()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::Base#render
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 41 def render super do capture do if control concat(content_tag(:span, nil, icon_html_options)) concat(content_tag(:span, control.to_s, class: 'sr-only')) end end end end
Private Instance Methods
assistive_html_attributes()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::Base#assistive_html_attributes
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 58 def assistive_html_attributes super.merge!(role: 'button') end
base_element()
click to toggle source
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 54 def base_element :a end
component_css_class()
click to toggle source
next is a reserved word, for here, we'll refer to options
Calls superclass method
NfgUi::Bootstrap::Components::Base#component_css_class
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 63 def component_css_class control ? "#{super}-#{control}" : super end
non_html_attribute_options()
click to toggle source
Calls superclass method
NfgUi::Bootstrap::Components::Base#non_html_attribute_options
# File lib/nfg_ui/bootstrap/components/carousel_control.rb, line 67 def non_html_attribute_options super.push(:control, :carousel) end