Class: Railsboot::Carousel::ItemComponent

Inherits:
Railsboot::Component
  • Object
show all
Defined in:
app/components/railsboot/carousel/item_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#activeObject (readonly)

Returns the value of attribute active.



2
3
4
# File 'app/components/railsboot/carousel/item_component.rb', line 2

def active
  @active
end