Class: BBCMobileStandards::AccessibilityValidator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(html_string) ⇒ AccessibilityValidator

Returns a new instance of AccessibilityValidator.



6
7
8
9
10
11
# File 'lib/bbc_mobile_standards/accessibility_validator.rb', line 6

def initialize(html_string)
  @html_string = html_string
  @page = Nokogiri::HTML(@html_string)
  @errors = []
  validate_page
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



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

def errors
  @errors
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/bbc_mobile_standards/accessibility_validator.rb', line 13

def valid?
  true unless @errors.size > 0
end