Class: Terraspace::Terraform::Args::Pass
- Inherits:
-
Object
- Object
- Terraspace::Terraform::Args::Pass
- Defined in:
- lib/terraspace/terraform/args/pass.rb
Instance Method Summary collapse
-
#args ⇒ Object
map to terraform options and only allow valid terraform options Arg Examples: -refresh-only -refresh=false -var ‘foo=bar’.
-
#initialize(mod, name, options = {}) ⇒ Pass
constructor
A new instance of Pass.
Constructor Details
#initialize(mod, name, options = {}) ⇒ Pass
Returns a new instance of Pass.
3 4 5 |
# File 'lib/terraspace/terraform/args/pass.rb', line 3 def initialize(mod, name, ={}) @mod, @name, @options = mod, name.underscore, end |
Instance Method Details
#args ⇒ Object
map to terraform options and only allow valid terraform options Arg Examples:
-refresh-only
-refresh=false
-var 'foo=bar'
12 13 14 15 16 17 18 19 |
# File 'lib/terraspace/terraform/args/pass.rb', line 12 def args args = pass_args.select do |arg| arg_name = get_arg_name(arg) terraform_arg_types.include?(arg_name) end args.map { |arg| "-#{arg}" } # add back in the leading single dash (-) end |