Class: Vastlint::Summary
- Inherits:
-
Object
- Object
- Vastlint::Summary
- Defined in:
- lib/vastlint/summary.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#infos ⇒ Object
readonly
Returns the value of attribute infos.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #as_json ⇒ Object
-
#initialize(errors:, warnings:, infos:, valid:) ⇒ Summary
constructor
A new instance of Summary.
- #to_h ⇒ Object
- #to_json(*args) ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(errors:, warnings:, infos:, valid:) ⇒ Summary
Returns a new instance of Summary.
9 10 11 12 13 14 |
# File 'lib/vastlint/summary.rb', line 9 def initialize(errors:, warnings:, infos:, valid:) @errors = errors @warnings = warnings @infos = infos @valid = valid end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
7 8 9 |
# File 'lib/vastlint/summary.rb', line 7 def errors @errors end |
#infos ⇒ Object (readonly)
Returns the value of attribute infos.
7 8 9 |
# File 'lib/vastlint/summary.rb', line 7 def infos @infos end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
7 8 9 |
# File 'lib/vastlint/summary.rb', line 7 def warnings @warnings end |
Instance Method Details
#as_json ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/vastlint/summary.rb', line 20 def as_json(*) { errors: errors, warnings: warnings, infos: infos, valid: valid? } end |
#to_h ⇒ Object
29 30 31 |
# File 'lib/vastlint/summary.rb', line 29 def to_h as_json end |
#to_json(*args) ⇒ Object
33 34 35 |
# File 'lib/vastlint/summary.rb', line 33 def to_json(*args) JSON.generate(as_json, *args) end |
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/vastlint/summary.rb', line 16 def valid? @valid end |