Class: Bulma::TagComponent
- Defined in:
- app/components/bulma/tag_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(color: nil, size: :normal, light: false) ⇒ TagComponent
constructor
A new instance of TagComponent.
Constructor Details
#initialize(color: nil, size: :normal, light: false) ⇒ TagComponent
Returns a new instance of TagComponent.
5 6 7 8 9 |
# File 'app/components/bulma/tag_component.rb', line 5 def initialize(color: nil, size: :normal, light: false) @size = size @color = color @light = light end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/components/bulma/tag_component.rb', line 11 def call content_tag :span, content, class: class_names( "tag", "is-light" => @light, "is-#{@color}" => @color, "is-#{@size}" => @size ) end |