lib/banktools-se/bankgiro.rb in banktools-se-0.0.1 vs lib/banktools-se/bankgiro.rb in banktools-se-0.2.0

- old
+ new

@@ -15,13 +15,13 @@ end def errors errors = [] - errors << :too_short if digits.length < 7 - errors << :too_long if digits.length > 8 - errors << :invalid_characters if number.to_s.match(/[^0-9 -]/) - errors << :bad_checksum unless BankTools::SE::Utils.valid_luhn?(number) + errors << Errors::TOO_SHORT if digits.length < 7 + errors << Errors::TOO_LONG if digits.length > 8 + errors << Errors::INVALID_CHARACTERS if number.to_s.match(/[^0-9 -]/) + errors << Errors::BAD_CHECKSUM unless BankTools::SE::Utils.valid_luhn?(number) errors end def normalize