Class: Ansible::Ruby::DslBuilders::Base

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

Direct Known Subclasses

Args, FileLevel, ModuleCall, Tasks, Unit

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



7
8
9
# File 'lib/ansible/ruby/dsl_builders/base.rb', line 7

def initialize
  @result = nil
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args, &block) ⇒ Object

For the DSL, don’t want to defer to regular method_missing



24
25
26
27
# File 'lib/ansible/ruby/dsl_builders/base.rb', line 24

def method_missing(id, *args, &block)
  result = _process_method id, *args, &block
  method_missing_return id, result, *args
end

Instance Method Details

#_resultObject



11
12
13
# File 'lib/ansible/ruby/dsl_builders/base.rb', line 11

def _result
  @result
end

#jinja(text) ⇒ Object



19
20
21
# File 'lib/ansible/ruby/dsl_builders/base.rb', line 19

def jinja(text)
  "{{ #{text} }}"
end

#respond_to_missing?Boolean

Returns:

  • (Boolean)


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

def respond_to_missing?(*)
  super
end