Class: Contracts::Key
- Inherits:
-
Object
- Object
- Contracts::Key
- Defined in:
- lib/custom_contracts.rb
Class Method Summary collapse
Class Method Details
.to_s ⇒ Object
46 47 48 |
# File 'lib/custom_contracts.rb', line 46 def self.to_s 'A JWT secret string or signature key' end |
.valid?(val) ⇒ Boolean
41 42 43 44 |
# File 'lib/custom_contracts.rb', line 41 def self.valid?(val) return false if val.is_a?(String) && val.strip.empty? C::Or[String, OpenSSL::PKey::RSA, OpenSSL::PKey::EC].valid?(val) end |