Class: DesignSystem::Generic::StartButtonComponent

Inherits:
BaseComponent
  • Object
show all
Defined in:
app/components/design_system/generic/start_button_component.rb

Overview

The "start a service" CTA. GOV.UK defined the pattern and NHS adopted it unchanged — both brands ship identical markup with only the brand-derived CSS prefix differing, so the implementation lives here.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from BrandDerivable

#brand

Constructor Details

#initialize(text, href, options = {}) ⇒ StartButtonComponent

Returns a new instance of StartButtonComponent.



7
8
9
10
11
12
# File 'app/components/design_system/generic/start_button_component.rb', line 7

def initialize(text, href, options = {})
  super()
  @text = text
  @href = href
  @options = options.merge('data-module': "#{brand}-button")
end

Instance Attribute Details

#hrefObject (readonly)

Returns the value of attribute href.



14
15
16
# File 'app/components/design_system/generic/start_button_component.rb', line 14

def href
  @href
end

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'app/components/design_system/generic/start_button_component.rb', line 14

def options
  @options
end

#textObject (readonly)

Returns the value of attribute text.



14
15
16
# File 'app/components/design_system/generic/start_button_component.rb', line 14

def text
  @text
end