Class: Goodsheet::ValidationErrors
- Inherits:
-
Object
- Object
- Goodsheet::ValidationErrors
- Defined in:
- lib/goodsheet/validation_errors.rb
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
Instance Method Summary collapse
- #add(line_number, row) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize ⇒ ValidationErrors
constructor
A new instance of ValidationErrors.
- #size ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ ValidationErrors
Returns a new instance of ValidationErrors.
6 7 8 |
# File 'lib/goodsheet/validation_errors.rb', line 6 def initialize @array = [] end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
4 5 6 |
# File 'lib/goodsheet/validation_errors.rb', line 4 def array @array end |
Instance Method Details
#add(line_number, row) ⇒ Object
10 11 12 |
# File 'lib/goodsheet/validation_errors.rb', line 10 def add(line_number, row) @array << ValidationError.new(line_number+1, row.errors) if row.invalid? end |
#empty? ⇒ Boolean
14 15 16 |
# File 'lib/goodsheet/validation_errors.rb', line 14 def empty? @array.empty? end |
#size ⇒ Object
18 19 20 |
# File 'lib/goodsheet/validation_errors.rb', line 18 def size @array.size end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/goodsheet/validation_errors.rb', line 22 def to_s @array.to_s end |