Class: Bulma::TitleComponent
- Defined in:
- app/components/bulma/title_component.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title = nil, as: :h1, size: 1) ⇒ TitleComponent
constructor
A new instance of TitleComponent.
Constructor Details
#initialize(title = nil, as: :h1, size: 1) ⇒ TitleComponent
Returns a new instance of TitleComponent.
5 6 7 8 9 10 11 |
# File 'app/components/bulma/title_component.rb', line 5 def initialize(title = nil, as: :h1, size: 1) raise ArgumentError, "invalid value to size" if size > 6 @title = title @as = as @size = size end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 |
# File 'app/components/bulma/title_component.rb', line 13 def call content_tag @as, @title || content, class: class_names( "title", "is-#{@size}" ) end |