Class: Ansible::Ruby::DslBuilders::Args
- Defined in:
- lib/ansible/ruby/dsl_builders/args.rb
Constant Summary collapse
- KERNEL_METHOD_OVERRIDES =
%i[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.
11 12 13 14 15 |
# File 'lib/ansible/ruby/dsl_builders/args.rb', line 11 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
17 18 19 20 21 22 23 |
# File 'lib/ansible/ruby/dsl_builders/args.rb', line 17 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 |