Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

210
Vistas
How to change this ruby match line to return true or false

Ok so my ruby is rusty. I have a line that looks for a match...

self.volunteer_event.description.match(/^Roster #/)

gives me this...

[1] pry(#<VolunteerShift>)> self.volunteer_event.description.match(/^Roster #/)
=> #<MatchData "Roster #">

I want to change it to give me "true" if it has a match or "false" for no

What simple ruby incantation can I use to achieve this?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Looking at the Regexp docs, I see match? and match. Use match? which returns a boolean. Functions that return a boolean often end with ? in Ruby.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda