Class: Valigator::CSV::RowValidators::Ragged
- Inherits:
-
Object
- Object
- Valigator::CSV::RowValidators::Ragged
- Defined in:
- lib/valigator/csv/row_validators/ragged.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #error_message ⇒ Object
- #error_type ⇒ Object
-
#initialize(options = {}) ⇒ Ragged
constructor
A new instance of Ragged.
- #valid?(row) ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ Ragged
Returns a new instance of Ragged.
9 10 11 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 9 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 5 def @options end |
Instance Method Details
#==(other) ⇒ Object
35 36 37 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 35 def ==(other) self.class == other.class && == other. end |
#error_message ⇒ Object
29 30 31 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 29 def 'Ragged or empty row' end |
#error_type ⇒ Object
23 24 25 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 23 def error_type 'ragged_row' end |
#valid?(row) ⇒ Boolean
15 16 17 18 19 |
# File 'lib/valigator/csv/row_validators/ragged.rb', line 15 def valid?(row) return true unless fields row.size >= fields.size end |