Sha256: 522a7f210b162b1802829567ba38fb7320cb2fc2b0eefc238c54e3ddd86c9f7b

Contents?: true

Size: 246 Bytes

Versions: 14

Compression:

Stored size: 246 Bytes

Contents

require 'securerandom'

module Fe
  module AccessKeyGenerator
    def generate_access_key
      begin
        self.access_key = SecureRandom.hex
      end while self.class.exists?(access_key: access_key)
      return access_key
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
fe-2.1.5 lib/access_key_generator.rb
fe-2.1.4 lib/access_key_generator.rb
fe-2.1.3 lib/access_key_generator.rb
fe-2.1.2 lib/access_key_generator.rb
fe-2.1.1 lib/access_key_generator.rb
fe-2.0.8 lib/access_key_generator.rb
fe-2.0.6 lib/access_key_generator.rb
fe-2.0.5 lib/access_key_generator.rb
fe-2.0.4 lib/access_key_generator.rb
fe-2.0.3 lib/access_key_generator.rb
fe-2.0.2 lib/access_key_generator.rb
fe-2.0.1 lib/access_key_generator.rb
fe-2.0.0 lib/access_key_generator.rb
fe-1.0.0 lib/access_key_generator.rb