lib/args_parser/validator.rb in args_parser-0.1.6 vs lib/args_parser/validator.rb in args_parser-0.2.0

- old
+ new

@@ -1,9 +1,11 @@ - module ArgsParser class Validator - def validators - @validators ||= [] + + attr_reader :validators + + def initialize + @validators = [] end def add(name, message, validator) name = name.to_sym if name validators.push({:name => name, :message => message, :validator => validator})