Class: CopyButton::Component
- Inherits:
-
Lookbook::BaseComponent
- Object
- Lookbook::BaseComponent
- CopyButton::Component
- Defined in:
- app/components/lookbook/copy_button/component.rb
Instance Attribute Summary collapse
-
#button_attrs ⇒ Object
readonly
Returns the value of attribute button_attrs.
-
#icon ⇒ Object
readonly
Returns the value of attribute icon.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #icon_size ⇒ Object
-
#initialize(target: nil, icon: :code, size: :md, **attrs) ⇒ Component
constructor
A new instance of Component.
Constructor Details
#initialize(target: nil, icon: :code, size: :md, **attrs) ⇒ Component
Returns a new instance of Component.
5 6 7 8 9 10 |
# File 'app/components/lookbook/copy_button/component.rb', line 5 def initialize(target: nil, icon: :code, size: :md, **attrs) @icon = icon @size = size @target = target @button_attrs = attrs end |
Instance Attribute Details
#button_attrs ⇒ Object (readonly)
Returns the value of attribute button_attrs.
3 4 5 |
# File 'app/components/lookbook/copy_button/component.rb', line 3 def @button_attrs end |
#icon ⇒ Object (readonly)
Returns the value of attribute icon.
3 4 5 |
# File 'app/components/lookbook/copy_button/component.rb', line 3 def icon @icon end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'app/components/lookbook/copy_button/component.rb', line 3 def size @size end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
3 4 5 |
# File 'app/components/lookbook/copy_button/component.rb', line 3 def target @target end |
Instance Method Details
#icon_size ⇒ Object
12 13 14 |
# File 'app/components/lookbook/copy_button/component.rb', line 12 def icon_size IconButton::Component::ICON_SIZES[size] end |