Sha256: f3b21525870bb71614b4f39a857863cbd7e6bebf3c094c9ec9bf136b59220bc2
Contents?: true
Size: 655 Bytes
Versions: 123
Compression:
Stored size: 655 Bytes
Contents
module GovukPublishingComponents module Presenters class SharedHelper attr_reader :options, :margin_bottom, :heading_level def initialize(local_assigns) @options = local_assigns @margin_bottom = @options[:margin_bottom] || 3 @heading_level = @options[:heading_level] || 2 end def get_margin_bottom [*0..9].include?(@margin_bottom) ? "govuk-!-margin-bottom-#{margin_bottom}" : "govuk-!-margin-bottom-3" end def get_heading_level return [*1..6].include?(@heading_level) ? "h#{@heading_level}" : "h2" unless @heading_level.zero? "span" end end end end
Version data entries
123 entries across 123 versions & 1 rubygems