Sha256: 7f2d53bcd0336719d565cdc082008aee0cbafd13cc2ce709f6f9a7f3e8fe5ef7
Contents?: true
Size: 709 Bytes
Versions: 16
Compression:
Stored size: 709 Bytes
Contents
module OptParseValidator # Implementation of the Array Option class OptArray < OptBase # @return [ Void ] def append_help_messages option << "Separator to use between the values: '#{separator}'" super end # @param [ String ] value # # @return [ Array ] def validate(value) super(value).split(separator) end # @return [ String ] The separator used to split the string into an array def separator attrs[:separator] || ',' end # See OptBase#normalize # @param [ Array ] values def normalize(values) values.each_with_index do |value, index| values[index] = super(value) end values end end end
Version data entries
16 entries across 16 versions & 1 rubygems