Sha256: 5e510937965f0f7fb617a44d65e7696b9d5bc9b8cde43801179ccf68b417b61c
Contents?: true
Size: 565 Bytes
Versions: 5
Compression:
Stored size: 565 Bytes
Contents
module OptParseValidator # Implementation of the Array Option class OptArray < OptBase # @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
5 entries across 5 versions & 1 rubygems