Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

205
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda