File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
lib/elasticsearch/model/response
spec/elasticsearch/model/response Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ def method_missing(name, *arguments)
4646
4747 # Respond to methods from `@result` or `@result._source`
4848 #
49- def respond_to ?( method_name , include_private = false )
49+ def respond_to_missing ?( method_name , include_private = false )
5050 @result . respond_to? ( method_name . to_sym ) || \
5151 @result . _source && @result . _source . respond_to? ( method_name . to_sym ) || \
5252 super
Original file line number Diff line number Diff line change 5353 expect ( result . _source ) . to eq ( 'bar' => { 'bam' => 'baz' } )
5454 end
5555
56+ it 'is recognized by #method' do
57+ expect ( result . method :bar ) . to be_a Method
58+ end
59+
60+ it 'respond_to? still works' do
61+ expect ( result . respond_to? :bar ) . to be true
62+ end
63+
5664 context 'when methods map to keys in subdocuments of the response from Elasticsearch' do
5765
5866 it 'provides access to top level fields via a method' do
You can’t perform that action at this time.
0 commit comments