Sha256: ad5130379245f4022b351fa19e6935b66df6b5b885d8d1ff1f29328b8a39b83e

Contents?: true

Size: 560 Bytes

Versions: 21

Compression:

Stored size: 560 Bytes

Contents

module TerraspacePluginAws::Interfaces
  class Decorator
    include Terraspace::Plugin::Decorator::Interface

    # interface method
    def call
      klass = decorator_class

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

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

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
terraspace_plugin_aws-0.6.1 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.6.0 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.5.1 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.5.0 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.4.2 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.4.1 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.4.0 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.8 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.7 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.6 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.5 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.4 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.3 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.2 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.1 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.3.0 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.2.2 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.2.1 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.2.0 lib/terraspace_plugin_aws/interfaces/decorator.rb
terraspace_plugin_aws-0.1.0 lib/terraspace_plugin_aws/interfaces/decorator.rb