Class: Ansible::Ruby::DslBuilders::Result
- Inherits:
-
Object
- Object
- Ansible::Ruby::DslBuilders::Result
- Defined in:
- lib/ansible/ruby/dsl_builders/result.rb
Instance Method Summary collapse
-
#initialize(name_fetcher) ⇒ Result
constructor
A new instance of Result.
-
#method_missing(id, *args) ⇒ Object
we need to respond to everything, don’t want super.
- #respond_to_missing? ⇒ Boolean
- #to_s ⇒ Object
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
17 18 19 |
# File 'lib/ansible/ruby/dsl_builders/result.rb', line 17 def respond_to_missing?(*) true end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/ansible/ruby/dsl_builders/result.rb', line 21 def to_s name end |