Class: Bulma::IconComponent
- Defined in:
- app/components/bulma/icon_component.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #classes ⇒ Object
-
#initialize(icon, text: nil, color: nil, size: nil) ⇒ IconComponent
constructor
A new instance of IconComponent.
Constructor Details
#initialize(icon, text: nil, color: nil, size: nil) ⇒ IconComponent
Returns a new instance of IconComponent.
17 18 19 20 21 |
# File 'app/components/bulma/icon_component.rb', line 17 def initialize(icon, text: nil, color: nil, size: nil) @text = text @color = color @icon = IoniconComponent.new(icon) end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
15 16 17 |
# File 'app/components/bulma/icon_component.rb', line 15 def text @text end |
Instance Method Details
#classes ⇒ Object
23 24 25 |
# File 'app/components/bulma/icon_component.rb', line 23 def classes class_names("icon", "has-text-#{@color}" => @color.present?) end |