Class: Bs5::ButtonToolbarComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/bs5/button_toolbar_component.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ ButtonToolbarComponent

Returns a new instance of ButtonToolbarComponent.



5
6
7
# File 'app/components/bs5/button_toolbar_component.rb', line 5

def initialize(options = {})
  @options = options
end

Instance Method Details

#component_attributesObject



13
14
15
16
17
18
19
# File 'app/components/bs5/button_toolbar_component.rb', line 13

def component_attributes
  default_options = { role: 'toolbar' }
  @options[:class] = Array(@options[:class])
  @options[:class] << 'btn-toolbar'

  @options.merge(default_options)
end

#render?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/components/bs5/button_toolbar_component.rb', line 9

def render?
  content.present?
end