Method: Keybox::RandomSource.register

Defined in:
lib/keybox/randomizer.rb

.register(klass) ⇒ Object



96
97
98
99
100
101
102
# File 'lib/keybox/randomizer.rb', line 96

def register(klass)
    if klass.respond_to?("random_bytes") then 
        @@SOURCE_CLASSES << klass unless @@SOURCE_CLASSES.include?(klass)
    else
        raise ArgumentError, "class #{klass.name} does not have a 'random_bytes' method"
    end
end