Class: Kitchen::Terraform::VersionVerifierStrategyFactory
- Inherits:
-
Object
- Object
- Kitchen::Terraform::VersionVerifierStrategyFactory
- Defined in:
- lib/kitchen/terraform/version_verifier_strategy_factory.rb
Overview
VersionVerifierStrategyFactory is the class of objects which build strategies for instances of VersionVerifier.
Instance Method Summary collapse
-
#build(version:) ⇒ Kitchen::Terraform::VersionVerifierStrategy::Supported, Kitchen::Terraform::VersionVerifierStrategy::Unsupported
#build creates a strategy.
-
#initialize(version_requirement:) ⇒ Kitchen::Terraform::VersionVerifierStrategyFactory
constructor
#initialize prepares a new instance of the class.
Constructor Details
#initialize(version_requirement:) ⇒ Kitchen::Terraform::VersionVerifierStrategyFactory
#initialize prepares a new instance of the class.
41 42 43 |
# File 'lib/kitchen/terraform/version_verifier_strategy_factory.rb', line 41 def initialize(version_requirement:) self.version_requirement = version_requirement end |
Instance Method Details
#build(version:) ⇒ Kitchen::Terraform::VersionVerifierStrategy::Supported, Kitchen::Terraform::VersionVerifierStrategy::Unsupported
#build creates a strategy.
29 30 31 32 33 34 35 |
# File 'lib/kitchen/terraform/version_verifier_strategy_factory.rb', line 29 def build(version:) if version_requirement.satisfied_by? version return ::Kitchen::Terraform::VersionVerifierStrategy::Supported.new else return ::Kitchen::Terraform::VersionVerifierStrategy::Unsupported.new end end |