Module: PulpPolymorphicResponsePatch
- Defined in:
- lib/monkeys/pulp_polymorphic_remote_response.rb
Class Method Summary collapse
Class Method Details
.patch_update_method(klass, method_name) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/monkeys/pulp_polymorphic_remote_response.rb', line 24 def self.patch_update_method(klass, method_name) with_http_info_method = :"#{method_name}_with_http_info" klass.class_eval do # Save reference to original _with_http_info method original_method = :"#{with_http_info_method}_original" alias_method original_method, with_http_info_method # Override the _with_http_info method to force AsyncOperationResponse return type define_method(with_http_info_method) do |href, data, opts = {}| # The generated bindings code uses: return_type = opts[:debug_return_type] || 'RpmRpmRemoteResponse' # By setting debug_return_type to AsyncOperationResponse, we override the default modified_opts = (opts || {}).merge(debug_return_type: 'AsyncOperationResponse') # Call original method with modified opts send(original_method, href, data, modified_opts) end end end |