Exception: ZendeskAppsSupport::Validations::ESLintValidationError
- Inherits:
-
ValidationError
- Object
- StandardError
- ValidationError
- ZendeskAppsSupport::Validations::ESLintValidationError
- Defined in:
- lib/zendesk_apps_support/validations/validation_error.rb
Constant Summary
Constants inherited from ValidationError
Instance Attribute Summary collapse
-
#eslint_errors ⇒ Object
readonly
Returns the value of attribute eslint_errors.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Attributes inherited from ValidationError
Class Method Summary collapse
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(filename, eslint_errors) ⇒ ESLintValidationError
constructor
A new instance of ESLintValidationError.
Methods inherited from ValidationError
from_hash, from_json, #to_json, #to_s
Constructor Details
#initialize(filename, eslint_errors) ⇒ ESLintValidationError
Returns a new instance of ESLintValidationError.
82 83 84 85 86 87 88 89 90 |
# File 'lib/zendesk_apps_support/validations/validation_error.rb', line 82 def initialize(filename, eslint_errors) errors = eslint_errors.compact.map { |err| "\n L#{err['line']}: #{err['message']}" }.join('') @filename = filename, @eslint_errors = eslint_errors super(:eslint, { file: filename, errors: errors, count: eslint_errors.length }) end |
Instance Attribute Details
#eslint_errors ⇒ Object (readonly)
Returns the value of attribute eslint_errors.
76 77 78 |
# File 'lib/zendesk_apps_support/validations/validation_error.rb', line 76 def eslint_errors @eslint_errors end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
76 77 78 |
# File 'lib/zendesk_apps_support/validations/validation_error.rb', line 76 def filename @filename end |
Class Method Details
.vivify(hash) ⇒ Object
78 79 80 |
# File 'lib/zendesk_apps_support/validations/validation_error.rb', line 78 def self.vivify(hash) new(hash['filename'], hash['eslint_errors']) end |
Instance Method Details
#as_json ⇒ Object
92 93 94 95 96 97 98 |
# File 'lib/zendesk_apps_support/validations/validation_error.rb', line 92 def as_json(*) { 'class' => self.class.to_s, 'filename' => filename, 'eslint_errors' => eslint_errors } end |