---
title: "Discussion on \"Membership in a list (Set)\" | Hashnode"
description: "Discussion on \"Membership in a list (Set)\". Using Set is probably the most convenient way to check for membership in a list since values are stored like in a Hash.\nSet uses the === method to check membership, which allows:\ncase 'apple'\nwhen Set['bean', 'cauliflower', 'carrot']\n  \"vegetable\"\nwh..."
url: "https://hashnode.com/posts/membership-in-a-list-set/69314dbb3ab44a2129e2b374"
---

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

Discussion

# [Membership in a list (Set)](https://langage-ruby.hashnode.dev/membership-in-a-list-set?utm_source=hashnode&utm_medium=feed)

Using Set is probably the most convenient way to check for membership in a list since values are stored like in a Hash. Set uses the === method to check membership, which allows: case 'apple' when Set\['bean', 'cauliflower', 'carrot'\] "vegetable" wh...

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

-   [#ruby](https://hashnode.com/tag/ruby)
-   [#en](https://hashnode.com/tag/en)
-   [#usa](https://hashnode.com/tag/usa)
-   [#set](https://hashnode.com/tag/set)
-   [#list](https://hashnode.com/tag/list)

## 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.
