Module: JWE::Alg
- Defined in:
- lib/jwe/alg.rb,
lib/jwe/alg/dir.rb,
lib/jwe/alg/rsa15.rb,
lib/jwe/alg/rsa_oaep.rb
Defined Under Namespace
Classes: Dir, Rsa15, RsaOaep
Class Method Summary
collapse
Class Method Details
.for(alg) ⇒ Object
7
8
9
10
11
12
13
14
|
# File 'lib/jwe/alg.rb', line 7
def self.for(alg)
klass = alg.gsub(/[-\+]/, '_').downcase.sub(/^[a-z\d]*/) { $&.capitalize }
klass.gsub!(/_([a-z\d]*)/i) { $1.capitalize }
const_get(klass)
rescue NameError
raise NotImplementedError.new("Unsupported alg type: #{alg}")
end
|