Sha256: 03e337eb4cfde7905002c6acf2e212ab1dd99a8ae90553636b7d732c17a5e315
Contents?: true
Size: 635 Bytes
Versions: 22
Compression:
Stored size: 635 Bytes
Contents
module Alchemy module Ingredients class HeadlineView < BaseView def initialize(ingredient, level: nil, html_options: {}) super(ingredient, html_options: html_options) @level = level end def call content_tag tag_name, id: dom_id, class: css_classes do ingredient.value end.html_safe end private def tag_name = "h#{@level || ingredient.level}" def dom_id = ingredient.dom_id.presence def css_classes [ ingredient.size ? "h#{ingredient.size}" : nil, html_options[:class] ] end end end end
Version data entries
22 entries across 22 versions & 1 rubygems