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)
46
46
47
47
# Respond to methods from `@result` or `@result._source`
48
48
#
49
- def respond_to ?( method_name , include_private = false )
49
+ def respond_to_missing ?( method_name , include_private = false )
50
50
@result . respond_to? ( method_name . to_sym ) || \
51
51
@result . _source && @result . _source . respond_to? ( method_name . to_sym ) || \
52
52
super
Original file line number Diff line number Diff line change 53
53
expect ( result . _source ) . to eq ( 'bar' => { 'bam' => 'baz' } )
54
54
end
55
55
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
+
56
64
context 'when methods map to keys in subdocuments of the response from Elasticsearch' do
57
65
58
66
it 'provides access to top level fields via a method' do
You can’t perform that action at this time.
0 commit comments