Class: TerraspacePluginAws::Interfaces::Decorator

Inherits:
Object
  • Object
show all
Includes:
Terraspace::Plugin::Decorator::Interface
Defined in:
lib/terraspace_plugin_aws/interfaces/decorator.rb,
lib/terraspace_plugin_aws/interfaces/decorator/base.rb,
lib/terraspace_plugin_aws/interfaces/decorator/aws_security_group.rb

Defined Under Namespace

Classes: AwsSecurityGroup, Base

Instance Method Summary collapse

Instance Method Details

#callObject

interface method



6
7
8
9
10
11
12
# File 'lib/terraspace_plugin_aws/interfaces/decorator.rb', line 6

def call
  klass = decorator_class

  return @props unless klass
  decorator = klass.new(@props) # IE: AwsSecurityGroup.new(@props)
  decorator.call
end

#decorator_classObject



14
15
16
17
18
19
# File 'lib/terraspace_plugin_aws/interfaces/decorator.rb', line 14

def decorator_class
  # IE: TerraspacePluginAws::Interfaces::Decorator::AwsSecurityGroup
  klass_name = "TerraspacePluginAws::Interfaces::Decorator::#{@type.camelize}"
  klass_name.constantize
rescue NameError
end