Class: Ansible::Ruby::DslBuilders::ModuleCall

Inherits:
Base
  • Object
show all
Defined in:
lib/ansible/ruby/dsl_builders/module_call.rb

Constant Summary collapse

MODULES_MOD =
Ansible::Ruby::Modules

Instance Method Summary collapse

Methods inherited from Base

#_result, #initialize, #jinja, #method_missing

Constructor Details

This class inherits a constructor from Ansible::Ruby::DslBuilders::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ansible::Ruby::DslBuilders::Base

Instance Method Details

#gem(*module_args, &block) ⇒ Object

Gem is a reserved Ruby keyword, method_missing alone will not catch it



21
22
23
# File 'lib/ansible/ruby/dsl_builders/module_call.rb', line 21

def gem(*module_args, &block)
  _process_method 'gem', *module_args, &block
end

#respond_to_missing?(method_name, _) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
18
# File 'lib/ansible/ruby/dsl_builders/module_call.rb', line 15

def respond_to_missing?(method_name, _)
  klass_name = _klass_name method_name
  MODULES_MOD.const_defined?(klass_name)
end