Class: LeapCA::Pool

Inherits:
Object
  • Object
show all
Defined in:
lib/leap_ca/pool.rb

Instance Method Summary collapse

Constructor Details

#initialize(config = {:size => 10}) ⇒ Pool

Returns a new instance of Pool.



5
6
7
# File 'lib/leap_ca/pool.rb', line 5

def initialize(config = {:size => 10})
  @config = config
end

Instance Method Details

#fillObject



9
10
11
12
13
14
# File 'lib/leap_ca/pool.rb', line 9

def fill
  while Cert.count < self.size do
    cert = Cert.create!
    puts " * Created client certificate #{cert.id}"
  end
end

#sizeObject



16
17
18
# File 'lib/leap_ca/pool.rb', line 16

def size
  @config[:size]
end