Class: Ansible::Ruby::DslBuilders::Args
- Defined in:
- lib/ansible/ruby/dsl_builders/args.rb
Constant Summary collapse
- KERNEL_METHOD_OVERRIDES =
[:system, :test, :warn, :sleep].freeze
Instance Method Summary collapse
- #_process_method(id, *args) ⇒ Object
-
#initialize(recipient, &block) ⇒ Args
constructor
A new instance of Args.
Methods inherited from Base
#_result, #jinja, #method_missing, #respond_to_missing?
Constructor Details
#initialize(recipient, &block) ⇒ Args
Returns a new instance of Args.
9 10 11 12 13 |
# File 'lib/ansible/ruby/dsl_builders/args.rb', line 9 def initialize(recipient, &block) super() @error_handler = block @recipient = recipient end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Ansible::Ruby::DslBuilders::Base
Instance Method Details
#_process_method(id, *args) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/ansible/ruby/dsl_builders/args.rb', line 15 def _process_method(id, *args) setter = "#{id}=".to_sym @error_handler[id] if @error_handler && !@recipient.respond_to?(setter) value = args.length == 1 ? args[0] : args value = _convert_ast_node value @recipient.send(setter, value) end |