Class: Acmaker::DSL::Converter

Inherits:
Object
  • Object
show all
Includes:
Utils::Helper
Defined in:
lib/acmaker/dsl/converter.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils::Helper

#diff, #matched?

Constructor Details

#initialize(exported, options) ⇒ Converter

Returns a new instance of Converter.



12
13
14
15
# File 'lib/acmaker/dsl/converter.rb', line 12

def initialize(exported, options)
  @exported = exported
  @options = options
end

Class Method Details

.convert(exported, options = {}) ⇒ Object



7
8
9
# File 'lib/acmaker/dsl/converter.rb', line 7

def convert(exported, options = {})
  new(exported, options).convert
end

Instance Method Details

#convertObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/acmaker/dsl/converter.rb', line 17

def convert
  certificates = []

  @exported.each do |domain_name, certificate|
    next if !certificate || !matched?(domain_name)
    certificates << output_certificate(domain_name, certificate)
  end

  certificates.join("\n")
end