Module: Enscalator::Templates

Defined in:
lib/enscalator/templates.rb,
lib/enscalator/vpc.rb,
lib/enscalator/vpc_with_nat_gateway.rb,
lib/enscalator/templates/vpc_peering.rb,
lib/enscalator/vpc_with_nat_instance.rb

Overview

Namespace for template collection

Defined Under Namespace

Classes: VPC, VPCPeering, VPCWithNATGateway, VPCWithNATInstance

Class Method Summary collapse

Class Method Details

.allArray

Get all loaded template classes

Returns:

  • (Array)


8
9
10
11
12
# File 'lib/enscalator/templates.rb', line 8

def self.all
  namespace = Enscalator::Templates
  templates = namespace.constants
  templates.map { |t| (namespace.to_s.split('::') << t.to_s).join('::').constantize }
end

.all_valid?Boolean

Verify if all loaded templates have required tpl method

Returns:

  • (Boolean)


16
17
18
# File 'lib/enscalator/templates.rb', line 16

def self.all_valid?
  all.map { |t| t.instance_methods.include?(:tpl) }.all?
end