Class: GovukRSpecHelpers::GovukCheckbox

Inherits:
Object
  • Object
show all
Defined in:
lib/check_govuk_checkbox.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page:, label_text:, hint_text:) ⇒ GovukCheckbox

Returns a new instance of GovukCheckbox.



6
7
8
9
10
# File 'lib/check_govuk_checkbox.rb', line 6

def initialize(page:, label_text:, hint_text:)
  @label_text = label_text
  @hint_text = hint_text
  @page = page
end

Instance Attribute Details

#hint_textObject (readonly)

Returns the value of attribute hint_text.



4
5
6
# File 'lib/check_govuk_checkbox.rb', line 4

def hint_text
  @hint_text
end

#label_textObject (readonly)

Returns the value of attribute label_text.



4
5
6
# File 'lib/check_govuk_checkbox.rb', line 4

def label_text
  @label_text
end

#pageObject (readonly)

Returns the value of attribute page.



4
5
6
# File 'lib/check_govuk_checkbox.rb', line 4

def page
  @page
end

Instance Method Details

#checkObject



12
13
14
# File 'lib/check_govuk_checkbox.rb', line 12

def check
  set_checked(true)
end

#uncheckObject



16
17
18
# File 'lib/check_govuk_checkbox.rb', line 16

def uncheck
  set_checked(false)
end