Class: Maglev::Uikit::Form::Richtext::ButtonComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/maglev/uikit/form/richtext/button_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, icon:, action_name: nil) ⇒ ButtonComponent

Returns a new instance of ButtonComponent.



10
11
12
13
14
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 10

def initialize(name:, icon:, action_name: nil)
  @name = name
  @action_name = action_name.presence || "toggle#{name.camelize}"
  @icon = icon
end

Instance Attribute Details

#action_nameObject (readonly)

Returns the value of attribute action_name.



8
9
10
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8

def action_name
  @action_name
end

#iconObject (readonly)

Returns the value of attribute icon.



8
9
10
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8

def icon
  @icon
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'app/components/maglev/uikit/form/richtext/button_component.rb', line 8

def name
  @name
end