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