Class: Railsboot::Carousel::ItemComponent
- Inherits:
-
Railsboot::Component
- Object
- Railsboot::Component
- Railsboot::Carousel::ItemComponent
- Defined in:
- app/components/railsboot/carousel/item_component.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
Instance Method Summary collapse
-
#initialize(active: false, **html_attributes) ⇒ ItemComponent
constructor
A new instance of ItemComponent.
Constructor Details
#initialize(active: false, **html_attributes) ⇒ ItemComponent
Returns a new instance of ItemComponent.
4 5 6 7 8 9 10 11 12 13 |
# File 'app/components/railsboot/carousel/item_component.rb', line 4 def initialize(active: false, **html_attributes) @active = active @html_attributes = html_attributes @html_attributes[:class] = class_names( "carousel-item", {"active" => @active}, html_attributes.delete(:class) ) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
2 3 4 |
# File 'app/components/railsboot/carousel/item_component.rb', line 2 def active @active end |