Module: Elasticsearch::Model::Proxy::Base
- Included in:
- ClassMethodsProxy, InstanceMethodsProxy
- Defined in:
- lib/elasticsearch/model/proxy.rb
Overview
Common module for the proxy classes
Instance Attribute Summary collapse
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #initialize(target) ⇒ Object
- #inspect ⇒ Object
-
#method_missing(method_name, *arguments, &block) ⇒ Object
Delegate methods to ‘@target`.
-
#respond_to?(method_name, include_private = false) ⇒ Boolean
Respond to methods from ‘@target`.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
Delegate methods to ‘@target`
120 121 122 |
# File 'lib/elasticsearch/model/proxy.rb', line 120 def method_missing(method_name, *arguments, &block) target.respond_to?(method_name) ? target.__send__(method_name, *arguments, &block) : super end |
Instance Attribute Details
#target ⇒ Object (readonly)
Returns the value of attribute target.
112 113 114 |
# File 'lib/elasticsearch/model/proxy.rb', line 112 def target @target end |
Instance Method Details
#initialize(target) ⇒ Object
114 115 116 |
# File 'lib/elasticsearch/model/proxy.rb', line 114 def initialize(target) @target = target end |
#inspect ⇒ Object
130 131 132 |
# File 'lib/elasticsearch/model/proxy.rb', line 130 def inspect "[PROXY] #{target.inspect}" end |
#respond_to?(method_name, include_private = false) ⇒ Boolean
Respond to methods from ‘@target`
126 127 128 |
# File 'lib/elasticsearch/model/proxy.rb', line 126 def respond_to?(method_name, include_private = false) target.respond_to?(method_name) || super end |