Class: Ant::SSL::SubInventory

Inherits:
Object
  • Object
show all
Defined in:
lib/ant/ssl/inventory.rb

Overview

Implements a single inventory. It creates certificates using similar configurations.

Instance Method Summary collapse

Constructor Details

#initialize(configs, inventory) ⇒ SubInventory

Returns a new instance of SubInventory.



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/ant/ssl/inventory.rb', line 49

def initialize(configs, inventory)
  defaults = configs['defaults']
  @parent = inventory
  @certificates = configs['certificates'].map do |cert|
    configuration = Configuration.new(
      inventory.defaults,
      defaults,
      cert
    )
    Certificate.new(configuration, inventory)
  end
end

Instance Method Details

#ca(name) ⇒ Object



66
67
68
# File 'lib/ant/ssl/inventory.rb', line 66

def ca(name)
  @certificates.find { |cert| cert.ca_name == name }
end

#create_certificates!Object



62
63
64
# File 'lib/ant/ssl/inventory.rb', line 62

def create_certificates!
  @certificates.each(&:create!)
end