---
title: "Discussion on \"Semi-predicate methods\" | Hashnode"
description: "Discussion on \"Semi-predicate methods\". In many languages, “predicates” are methods that return either true or false. In Ruby, they’re traditionally marked with a trailing question mark.\ndef are_you_ok?\n  if yes\n    true\n  else\n    false\n  end\nend\n\nThis question mark is only a convention. ..."
url: "https://hashnode.com/posts/semi-predicate-methods/692eaac1d662d584fcc23ffe"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Semi-predicate methods](https://langage-ruby.hashnode.dev/semi-predicate-methods?utm_source=hashnode&utm_medium=feed)

In many languages, “predicates” are methods that return either true or false. In Ruby, they’re traditionally marked with a trailing question mark. def are\_you\_ok? if yes true else false end end This question mark is only a convention. ...

Dec 2, 2025 · 1 min read · langage-ruby.hashnode.dev  
Read the article

-   [#semi-predicate](https://hashnode.com/tag/semi-predicate)
-   [#ruby](https://hashnode.com/tag/ruby)
-   [#us](https://hashnode.com/tag/us)
-   [#en](https://hashnode.com/tag/en)
-   [#predicate](https://hashnode.com/tag/predicate)

## Written by

[Philicare](https://hashnode.com/@philicare)

@philicare

  
[View profile](https://hashnode.com/@philicare)

Share and learn

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
