Class: GetIgnoredViolation
- Inherits:
-
Object
- Object
- GetIgnoredViolation
- Defined in:
- lib/danger/request_sources/support/get_ignored_violation.rb
Constant Summary collapse
- IGNORE_REGEXP =
/>*\s*danger\s*:\s*ignore\s*"(?<error>[^"]*)"/i
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(body) ⇒ GetIgnoredViolation
constructor
A new instance of GetIgnoredViolation.
Constructor Details
#initialize(body) ⇒ GetIgnoredViolation
Returns a new instance of GetIgnoredViolation.
4 5 6 |
# File 'lib/danger/request_sources/support/get_ignored_violation.rb', line 4 def initialize(body) @body = body end |
Instance Method Details
#call ⇒ Object
8 9 10 11 12 |
# File 'lib/danger/request_sources/support/get_ignored_violation.rb', line 8 def call return [] unless body body.chomp.scan(IGNORE_REGEXP).flatten end |