Class: Danger::Changelog::Parsers::ValidationResult
- Inherits:
-
Object
- Object
- Danger::Changelog::Parsers::ValidationResult
- Defined in:
- lib/changelog/parsers/validation_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #error!(message) ⇒ Object
-
#initialize ⇒ ValidationResult
constructor
A new instance of ValidationResult.
- #invalid? ⇒ Boolean
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ ValidationResult
Returns a new instance of ValidationResult.
5 6 7 |
# File 'lib/changelog/parsers/validation_result.rb', line 5 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
9 10 11 |
# File 'lib/changelog/parsers/validation_result.rb', line 9 def errors @errors end |
Instance Method Details
#error!(message) ⇒ Object
19 20 21 |
# File 'lib/changelog/parsers/validation_result.rb', line 19 def error!() errors << end |
#invalid? ⇒ Boolean
15 16 17 |
# File 'lib/changelog/parsers/validation_result.rb', line 15 def invalid? !valid? end |
#to_s ⇒ Object
23 24 25 26 27 |
# File 'lib/changelog/parsers/validation_result.rb', line 23 def to_s return nil if valid? errors.join(', ') end |
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/changelog/parsers/validation_result.rb', line 11 def valid? errors.empty? end |