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