Module: OpenSearch::DSL::Search::BaseCompoundFilterComponent::MethodDelegation
- Defined in:
- lib/opensearch/dsl/search/base_compound_filter_component.rb
Instance Method Summary collapse
-
#method_missing(name, *args, &block) ⇒ Object
Looks up the corresponding class for a method being invoked, and initializes it.
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
Looks up the corresponding class for a method being invoked, and initializes it
111 112 113 114 115 |
# File 'lib/opensearch/dsl/search/base_compound_filter_component.rb', line 111 def method_missing(name, *args, &block) klass = Utils.__camelize(name) raise NoMethodError, "undefined method '#{name}' for #{self}" unless Filters.const_defined? klass @value << Filters.const_get(klass).new(*args, &block) end |
Instance Method Details
#respond_to_missing?(method_name, include_private = false) ⇒ Boolean
117 118 119 |
# File 'lib/opensearch/dsl/search/base_compound_filter_component.rb', line 117 def respond_to_missing?(method_name, include_private = false) Filters.const_defined?(Utils.__camelize(method_name)) || super end |