Class: FixA11yGenerator
- Inherits:
-
Sublayer::Generators::Base
- Object
- Sublayer::Generators::Base
- FixA11yGenerator
- Defined in:
- lib/generators/fix_a11y_generator.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(contents:, issue:, extension: '', additional_prompt: nil) ⇒ FixA11yGenerator
constructor
A new instance of FixA11yGenerator.
- #prompt ⇒ Object
Constructor Details
#initialize(contents:, issue:, extension: '', additional_prompt: nil) ⇒ FixA11yGenerator
Returns a new instance of FixA11yGenerator.
6 7 8 9 10 11 |
# File 'lib/generators/fix_a11y_generator.rb', line 6 def initialize(contents:, issue:, extension: '', additional_prompt: nil) @extension = extension @contents = contents @issue = issue @additional_prompt = additional_prompt end |
Instance Method Details
#generate ⇒ Object
13 14 15 |
# File 'lib/generators/fix_a11y_generator.rb', line 13 def generate super end |
#prompt ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/generators/fix_a11y_generator.rb', line 17 def prompt <<~PROMPT Given the following #{@extension} template contents and an accessibility issue, generate a new #{@extension} file with the issue fixed, leaving the rest of the contents unchanged. #{@extension} code: #{@contents} Accessibility issue: #{@issue} Additional user instructions (if any): #{@additional_prompt || 'None'} Return the contents with the issue fixed. PROMPT end |