Class: NfgUi::Bootstrap::Components::CarouselIndicators
- Inherits:
-
Base
- Object
- Base
- NfgUi::Bootstrap::Components::CarouselIndicators
show all
- Defined in:
- lib/nfg_ui/bootstrap/components/carousel_indicators.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#options, #view_context
Instance Method Summary
collapse
Methods inherited from Base
#data, #href, #html_options, #id, #initialize, #style
Instance Method Details
#active ⇒ Object
9
10
11
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 9
def active
options.fetch(:active, 1) end
|
#body ⇒ Object
Carousel Indicators do not accept a body
14
15
16
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 14
def body
nil
end
|
#carousel ⇒ Object
26
27
28
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 26
def carousel
options.fetch(:carousel, nil)
end
|
#component_family ⇒ Object
18
19
20
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 18
def component_family
:carousel
end
|
#count ⇒ Object
22
23
24
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 22
def count
options[:count] || 0 end
|
#render ⇒ Object
30
31
32
33
34
35
36
37
38
|
# File 'lib/nfg_ui/bootstrap/components/carousel_indicators.rb', line 30
def render
super do
capture do
count.times do |i|
concat(content_tag(:li, nil, class: ('active' if active == i + 1), data: { target: carousel, slide_to: i }))
end
end
end
end
|