Class: Alchemy::Ingredients::HeadlineView
- Defined in:
- app/components/alchemy/ingredients/headline_view.rb
Instance Attribute Summary
Attributes inherited from BaseView
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ingredient, level: nil, html_options: {}) ⇒ HeadlineView
constructor
A new instance of HeadlineView.
Methods inherited from BaseView
Constructor Details
#initialize(ingredient, level: nil, html_options: {}) ⇒ HeadlineView
Returns a new instance of HeadlineView.
4 5 6 7 |
# File 'app/components/alchemy/ingredients/headline_view.rb', line 4 def initialize(ingredient, level: nil, html_options: {}) super(ingredient, html_options: ) @level = level end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'app/components/alchemy/ingredients/headline_view.rb', line 9 def call content_tag "h#{@level || ingredient.level}", ingredient.value, id: ingredient.dom_id.presence, class: [ ingredient.size ? "h#{ingredient.size}" : nil, [:class] ] end |