Class: Continuum::FixType

Inherits:
Object
  • Object
show all
Defined in:
src/lib/continuum/fix_type.rb

Overview

A class that encapsulates remediation steps suggested by Access Engine for resolving an accessibility concern.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dom_spec, helper_text) ⇒ FixType

Returns a new instance of FixType.

Parameters:

  • dom_spec (Boolean)

    Defines whether this fix is specific to the particular page under test

  • helper_text (String)

    A brief human-readable description of how to resolve the accessibility concern corresponding to this fix



26
27
28
29
# File 'src/lib/continuum/fix_type.rb', line 26

def initialize(dom_spec, helper_text)
  @dom_spec = dom_spec
  @helper_text = helper_text
end

Instance Attribute Details

#dom_specBoolean

Gets whether this fix is specific to the particular page under test, or more general.

Returns:

  • (Boolean)

    Whether this fix is specific to the particular page under test, or more general



14
15
16
# File 'src/lib/continuum/fix_type.rb', line 14

def dom_spec
  @dom_spec
end

#helper_textString

Gets a brief human-readable description of how to resolve the accessibility concern corresponding to this fix. Consult AMP for additional information.

Returns:

  • (String)

    A brief human-readable description of how to resolve the accessibility concern corresponding to this fix



21
22
23
# File 'src/lib/continuum/fix_type.rb', line 21

def helper_text
  @helper_text
end

Class Method Details

.from_json(json_data) ⇒ FixType

Parameters:

  • json_data (String, Hash)

Returns:



33
34
35
36
# File 'src/lib/continuum/fix_type.rb', line 33

def self.from_json(json_data)
  parsed = DataUtil.parse_json(json_data) || {}
  return new(parsed['domSpec'], parsed['helperText'])
end