Sha256: 342237fef3f0ce10d2780b2a9f8016142a4ae11d58f7230692bfc2a754d7434d
Contents?: true
Size: 417 Bytes
Versions: 13
Compression:
Stored size: 417 Bytes
Contents
module OptParseValidator # Implementation of the Credentials Option class OptCredentials < OptBase # @return [ Hash ] A hash containing the :username and :password def validate(value) unless value.index(':') fail Error, 'Incorrect credentials format, username:password expected' end creds = value.split(':', 2) { username: creds[0], password: creds[1] } end end end
Version data entries
13 entries across 13 versions & 1 rubygems