Fix #25723: ruby-nextgen Response no longer advertises to_hash when data has none

IN
1d ago
+89-3

Fixes #25723

The generated Response class used def_delegators :data, ..., :to_hash, :dig — Forwardable's static delegation defines to_hash on Response unconditionally, so respond_to?(:to_hash) is true even when data (Array/nil/primitive) has no to_hash, and calling it raises NoMethodError (the issue's repro).

:to_hash is removed from the static delegators and dispatched via method_missing/respond_to_missing? gated on data.respond_to?(:to_hash): Array/nil now honestly report no to_hash (with "Did you mean? to_h"), Hash/model data still delegates. Other delegators and to_h untouched.

1 generator test + regenerated petstore/qdrant samples + 5-case rspec spec (picked up by the samples-ruby-nextgen workflow); standalone Ruby semantics check: 9/9 assertions. RubyNextgenClientCodegenTest 25/25 green.


Summary by cubic

Fixes #25723 by making the ruby-nextgen Response class report to_hash only when its data actually supports it. Previously def_delegators :data, ..., :to_hash defined to_hash unconditionally, so respond_to?(:to_hash) returned true for Array, nil, and primitive data even though calling it raised NoMethodError.

to_hash is now dispatched via method_missing/respond_to_missing? and only delegated when data.respond_to?(:to_hash). Other delegators and to_h behavior are unchanged.