Class: Olivander::Components::TabsComponent::Tab

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/olivander/components/tabs_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false) ⇒ Tab

Returns a new instance of Tab.



25
26
27
28
29
30
# File 'app/components/olivander/components/tabs_component.rb', line 25

def initialize(title:, id: "tab-#{SecureRandom.hex(6)}", active: false)
  super
  @title = title
  @id = id
  @active = active
end

Instance Attribute Details

#activeObject (readonly)

Returns the value of attribute active.



23
24
25
# File 'app/components/olivander/components/tabs_component.rb', line 23

def active
  @active
end

#idObject (readonly)

Returns the value of attribute id.



23
24
25
# File 'app/components/olivander/components/tabs_component.rb', line 23

def id
  @id
end

#titleObject (readonly)

Returns the value of attribute title.



23
24
25
# File 'app/components/olivander/components/tabs_component.rb', line 23

def title
  @title
end

Instance Method Details

#callObject



32
33
34
# File 'app/components/olivander/components/tabs_component.rb', line 32

def call
  content
end