Module: AwsSingularResourceMixin
- Includes:
- AwsResourceMixin
- Included in:
- AwsCloudTrailTrail, AwsCloudwatchAlarm, AwsCloudwatchLogMetricFilter, AwsConfigDeliveryChannel, AwsConfigurationRecorder, AwsEcsCluster, AwsElb, AwsFlowLog, AwsIamAccessKey, AwsIamGroup, AwsIamPolicy, AwsIamRole, AwsIamUser, AwsKmsKey, AwsRdsInstance, AwsRouteTable, AwsS3Bucket, AwsS3BucketObject, AwsSecurityGroup, AwsSnsSubscription, AwsSnsTopic, AwsSubnet, AwsVpc
- Defined in:
- lib/resource_support/aws/aws_singular_resource_mixin.rb
Class Method Summary collapse
-
.included(base) ⇒ Object
This sets up a class, AwsSomeResource::BackendFactory, that provides a mechanism to create and use backends without having to know which is selected.
Instance Method Summary collapse
Methods included from AwsResourceMixin
#catch_aws_errors, #check_resource_param_names, #initialize, #inspec_runner, #validate_params
Class Method Details
.included(base) ⇒ Object
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.
15 16 17 18 19 20 21 22 23 |
# File 'lib/resource_support/aws/aws_singular_resource_mixin.rb', line 15 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 |
Instance Method Details
#exists? ⇒ Boolean
4 5 6 |
# File 'lib/resource_support/aws/aws_singular_resource_mixin.rb', line 4 def exists? @exists end |