Sha256: 4eb8cc1bf296b29bfd00c8ac9a9851036c6e386b1de31c64c6d25810dc00d84e
Contents?: true
Size: 740 Bytes
Versions: 14
Compression:
Stored size: 740 Bytes
Contents
# frozen_string_literal: true 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
14 entries across 14 versions & 1 rubygems