Class: Ruby::Terraform::Commands::ValidateCommand
- Inherits:
-
Object
- Object
- Ruby::Terraform::Commands::ValidateCommand
- Includes:
- ExecutionSupport
- Defined in:
- lib/ruby/terraform/commands/validate_command.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#json ⇒ Object
Returns the value of attribute json.
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(opts = {}) ⇒ ValidateCommand
constructor
A new instance of ValidateCommand.
Methods included from ExecutionSupport
Constructor Details
#initialize(opts = {}) ⇒ ValidateCommand
Returns a new instance of ValidateCommand.
10 11 12 13 |
# File 'lib/ruby/terraform/commands/validate_command.rb', line 10 def initialize(opts = {}) @dir = opts[:dir] @json = opts[:json] end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
7 8 9 |
# File 'lib/ruby/terraform/commands/validate_command.rb', line 7 def dir @dir end |
#json ⇒ Object
Returns the value of attribute json.
8 9 10 |
# File 'lib/ruby/terraform/commands/validate_command.rb', line 8 def json @json end |
Instance Method Details
#command ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/ruby/terraform/commands/validate_command.rb', line 15 def command cmd = %W[#{tf_binary} validate] cmd += ['-json'] if json cmd += [dir] if dir cmd end |