Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

obj.respond_to? :method_name isn't working correctly

Abierto
#1,273 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
40/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
ruby
Área
api, backend

Línea de trabajo

Comienza reproduciendo el comportamiento con shopify_api versión 13.4 usando el product API object y los pasos de respond_to? indicados en el issue. Rastrea cómo respond_to? produce true, false o T::Private::Types::Void::VOID; se considera terminado cuando devuelve true o false de forma consistente y una llamada no compatible genera NoMethodError.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Issue summary

When using api_object.respond_to?(:method_name) the lib sometimes returns true and sometimes returns T::Private::Types::Void::VOID Sorbet private void type. It seems that true was returned if the method name had been previously used to dereference the object but on more inspection I am not so sure that's the case.

  • shopify_api version: 13.4
  • Ruby version:
  • Operating system:

Expected behavior

When calling respond_to? with a method name the object should return true if the object is able to respond to the method call or false if it is not, and if you call the method name on the object after it returns false it should raise a NoMethodError

Actual behavior

Sometimes the response is true, sometimes it's a private Sorbet type T::Private::Types::Void::VOID, and sometimes it switches from the private type to true after you dereference the object with the method in question.

Steps to reproduce the problem

  1. Instantiate an api object (I used a product)
  2. Invoke respond_to? on it ( api_object.respond_to? :some_bs_method )
  3. Bonus points - try invoking the method on the object after receiving the Sorbet type as a response and then calling respond_to? with the method name, it was returning true for me after doing so
Lenguaje dominante
Ruby
Estrellas
1.1k
Forks
484
Merge medio
4 h 38 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Shopify/shopify-api-ruby

Todos los issues de Shopify/shopify-api-ruby

Issues similares

Más issues de Ruby

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.