Class: Ansible::Ruby::DslBuilders::Result

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

Instance Method Summary collapse

Constructor Details

#initialize(name_fetcher) ⇒ Result

Returns a new instance of Result.



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

def initialize(name_fetcher)
  @name_fetcher = name_fetcher
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(id, *args) ⇒ Object

we need to respond to everything, don’t want super



12
13
14
15
# File 'lib/ansible/ruby/dsl_builders/result.rb', line 12

def method_missing(id, *args)
  flat_args = args.map(&:inspect).map(&:to_s).join ', '
  "#{name}.#{id}#{flat_args.empty? ? '' : "(#{flat_args})"}"
end

Instance Method Details

#respond_to_missing?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/ansible/ruby/dsl_builders/result.rb', line 17

def respond_to_missing?(*)
  true
end

#to_sObject



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

def to_s
  name
end