Class: GovukPublishingComponents::Presenters::HeadingHelper
- Inherits:
-
Object
- Object
- GovukPublishingComponents::Presenters::HeadingHelper
- Defined in:
- lib/govuk_publishing_components/presenters/heading_helper.rb
Instance Attribute Summary collapse
-
#classes ⇒ Object
readonly
Returns the value of attribute classes.
-
#heading_tag ⇒ Object
readonly
Returns the value of attribute heading_tag.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(options) ⇒ HeadingHelper
constructor
A new instance of HeadingHelper.
Constructor Details
#initialize(options) ⇒ HeadingHelper
Returns a new instance of HeadingHelper.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/govuk_publishing_components/presenters/heading_helper.rb', line 6 def initialize() @id = [:id] @classes = "" @classes << heading_size([:font_size]) @classes << " gem-c-heading--mobile-top-margin" if [:mobile_top_margin] @classes << " gem-c-heading--padding" if [:padding] @classes << " gem-c-heading--border-top-#{[:border_top]}" if [1, 2, 5].include? [:border_top] @classes << " gem-c-heading--inverse" if [:inverse] end |
Instance Attribute Details
#classes ⇒ Object (readonly)
Returns the value of attribute classes.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/heading_helper.rb', line 4 def classes @classes end |
#heading_tag ⇒ Object (readonly)
Returns the value of attribute heading_tag.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/heading_helper.rb', line 4 def heading_tag @heading_tag end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/govuk_publishing_components/presenters/heading_helper.rb', line 4 def id @id end |