Class: Maglev::Uikit::TabsComponent::Tab

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/maglev/uikit/tabs_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseComponent

#button_class_names

Constructor Details

#initialize(component, label:, active:, link:, block: nil) ⇒ Tab

Returns a new instance of Tab.



64
65
66
67
68
69
70
# File 'app/components/maglev/uikit/tabs_component.rb', line 64

def initialize(component, label:, active:, link:, block: nil)
  @component = component
  @label = label
  @active = active
  @link = link
  @block = block
end

Instance Attribute Details

#active=(value) ⇒ Object (writeonly)

Sets the attribute active

Parameters:

  • value

    the value to set the attribute active to.



62
63
64
# File 'app/components/maglev/uikit/tabs_component.rb', line 62

def active=(value)
  @active = value
end

#blockObject (readonly)

Returns the value of attribute block.



61
62
63
# File 'app/components/maglev/uikit/tabs_component.rb', line 61

def block
  @block
end

#labelObject (readonly)

Returns the value of attribute label.



61
62
63
# File 'app/components/maglev/uikit/tabs_component.rb', line 61

def label
  @label
end

Returns the value of attribute link.



61
62
63
# File 'app/components/maglev/uikit/tabs_component.rb', line 61

def link
  @link
end

Instance Method Details

#active?Boolean

Returns:

  • (Boolean)


72
73
74
# File 'app/components/maglev/uikit/tabs_component.rb', line 72

def active?
  @active
end

#block?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'app/components/maglev/uikit/tabs_component.rb', line 76

def block?
  @block.present?
end

#link?Boolean

Returns:

  • (Boolean)


80
81
82
# File 'app/components/maglev/uikit/tabs_component.rb', line 80

def link?
  @link.present?
end


84
85
86
# File 'app/components/maglev/uikit/tabs_component.rb', line 84

def link_html_options
  @link[:html_options] || {}
end