Class: PreCommit::ErrorList
- Inherits:
-
Struct
- Object
- Struct
- PreCommit::ErrorList
- Defined in:
- lib/pre-commit/error_list.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(errors = []) ⇒ ErrorList
constructor
A new instance of ErrorList.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
permalink #initialize(errors = []) ⇒ ErrorList
Returns a new instance of ErrorList.
6 7 8 9 10 11 12 |
# File 'lib/pre-commit/error_list.rb', line 6 def initialize(errors = []) case errors when "",nil then errors = [] when String then errors = [PreCommit::Line.new(errors)] end super errors end |
Instance Attribute Details
permalink #errors ⇒ Object
Returns the value of attribute errors
4 5 6 |
# File 'lib/pre-commit/error_list.rb', line 4 def errors @errors end |
Instance Method Details
permalink #to_a ⇒ Object
[View source]
14 15 16 |
# File 'lib/pre-commit/error_list.rb', line 14 def to_a errors.map(&:to_s) end |
permalink #to_s ⇒ Object
[View source]
18 19 20 |
# File 'lib/pre-commit/error_list.rb', line 18 def to_s to_a.join("\n") end |