Sha256: b3a488e11eb1169d31ac3123cab483e5a9d7d72d4e80dc982af6668291692c34
Contents?: true
Size: 441 Bytes
Versions: 5
Compression:
Stored size: 441 Bytes
Contents
require 'securerandom' module CertificateAuthority class SerialNumber include Validations include Revocable attr_accessor :number def validate if self.number.nil? errors.add :number, "must not be empty" elsif self.number.to_i <= 0 errors.add :number, "must be greater than zero" end end def initialize self.number = SecureRandom.random_number(2**128-1) end end end
Version data entries
5 entries across 5 versions & 2 rubygems