lib/bitmapped/validators/validation_helper.rb in bitmapped-0.1.0 vs lib/bitmapped/validators/validation_helper.rb in bitmapped-0.2.0
- old
+ new
@@ -1,13 +1,16 @@
require 'bitmapped/exceptions'
module Bitmapped
module Validators
module ValidationHelper
+
+ ALPHABET = [*'A'..'Z']
+
class << self
def parse_color(color)
color = color.strip
- if [*'A'..'Z'].include?(color)
+ if ALPHABET.include?(color)
color
else
raise ParsingError
end
end
\ No newline at end of file