Module: Terraspace::Terraform::Args::Dsl
- Includes:
- Shorthands
- Included in:
- Custom
- Defined in:
- lib/terraspace/terraform/args/dsl.rb
Constant Summary
Constants included
from Shorthands
Shorthands::COMMANDS_WITH_INPUT, Shorthands::COMMANDS_WITH_LOCKING, Shorthands::COMMANDS_WITH_PARALLELISM, Shorthands::COMMANDS_WITH_VARS
Instance Method Summary
collapse
Methods included from Shorthands
#shorthands
Instance Method Details
#command(*commands, **props) ⇒ Object
Also known as:
commands
5
6
7
8
9
10
11
12
13
|
# File 'lib/terraspace/terraform/args/dsl.rb', line 5
def command(*commands, **props)
commands.each do |name|
if shorthand?(name)
shorthand_commands(name, props)
else
each_command(name, props)
end
end
end
|
#each_command(name, props = {}) ⇒ Object
26
27
28
|
# File 'lib/terraspace/terraform/args/dsl.rb', line 26
def each_command(name, props={})
@commands[name] = props
end
|
#shorthand?(name) ⇒ Boolean
16
17
18
|
# File 'lib/terraspace/terraform/args/dsl.rb', line 16
def shorthand?(name)
shorthands.key?(name.to_sym)
end
|
#shorthand_commands(name, props) ⇒ Object
20
21
22
23
24
|
# File 'lib/terraspace/terraform/args/dsl.rb', line 20
def shorthand_commands(name, props)
shorthands[name].each do |n|
each_command(n, props)
end
end
|