Class: Kitchen::Terraform::InSpecFactory
- Inherits:
-
Object
- Object
- Kitchen::Terraform::InSpecFactory
- Defined in:
- lib/kitchen/terraform/inspec_factory.rb
Overview
InSpecFactory is the class of objects which build InSpec objects.
Instance Method Summary collapse
-
#build(options:, profile_locations:) ⇒ Kitchen::Terraform::InSpec::WithoutHosts, ...
#build creates a new instance of an InSpec object.
-
#initialize(fail_fast:, hosts:) ⇒ Kitchen::Terraform::InSpecFactory
constructor
#initialize prepares a new instance of the class.
Constructor Details
#initialize(fail_fast:, hosts:) ⇒ Kitchen::Terraform::InSpecFactory
#initialize prepares a new instance of the class
58 59 60 61 |
# File 'lib/kitchen/terraform/inspec_factory.rb', line 58 def initialize(fail_fast:, hosts:) self.fail_fast = fail_fast self.hosts = hosts end |
Instance Method Details
#build(options:, profile_locations:) ⇒ Kitchen::Terraform::InSpec::WithoutHosts, ...
#build creates a new instance of an InSpec object.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/kitchen/terraform/inspec_factory.rb', line 32 def build(options:, profile_locations:) if hosts.empty? ::Kitchen::Terraform::InSpec::WithoutHosts.new( options: , profile_locations: profile_locations, ) elsif fail_fast ::Kitchen::Terraform::InSpec::FailFastWithHosts.new( hosts: hosts, options: , profile_locations: profile_locations, ) else ::Kitchen::Terraform::InSpec::FailSlowWithHosts.new( hosts: hosts, options: , profile_locations: profile_locations, ) end end |