Sha256: a56001ecb5df6545970aa220797c55f7293240f01140cafeb46477dcacce7010
Contents?: true
Size: 696 Bytes
Versions: 10
Compression:
Stored size: 696 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}'" 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
10 entries across 10 versions & 1 rubygems