Sha256: a4ca90f6c672a3e3a499d5a3e218a3ad6641ec4498272c11e54fe63f0cc1c719

Contents?: true

Size: 856 Bytes

Versions: 5

Compression:

Stored size: 856 Bytes

Contents

module AwsSingularResourceMixin
  include AwsResourceMixin

  def exists?
    @exists
  end

  # This sets up a class, AwsSomeResource::BackendFactory, that
  # provides a mechanism to create and use backends without
  # having to know which is selected.  This is mainly used for
  # unit testing.
  # TODO: DRY up.  This code exists in both the Singular and Plural mixins.
  # We'd like to put it in AwsResourceMixin, but included only sees the
  # directly-including class - we can't see second-order includers.
  def self.included(base)
    # Create a new class, whose body is simply to extend the
    # backend factory mixin
    resource_backend_factory_class = Class.new(Object) do
      extend AwsBackendFactoryMixin
    end
    # Name that class
    base.const_set('BackendFactory', resource_backend_factory_class)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 lib/resource_support/aws/aws_singular_resource_mixin.rb
inspec-2.1.21 lib/resource_support/aws/aws_singular_resource_mixin.rb
inspec-2.1.10 lib/resource_support/aws/aws_singular_resource_mixin.rb
inspec-2.0.32 lib/resource_support/aws/aws_singular_resource_mixin.rb
inspec-2.0.17 lib/resource_support/aws/aws_singular_resource_mixin.rb