VOOZH about

URL: https://www.geeksforgeeks.org/ruby/ruby-queue-closed-function/

⇱ Ruby | Queue closed? function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Ruby | Queue closed? function

Last Updated : 12 Jul, 2025
The closed? is an inbuilt function in Ruby checks if the queue is closed or not?. It returns a boolean value, which is true if the Queue is closed or it returns false.
Syntax: q_name.closed? Parameters: The function does not takes any element. Return Value: It returns true if the queue is closed else it returns false.
Example 1: Output:
false
true
Example 2: Output:
closed
Reference: https://devdocs.io/ruby~2.5/queue#method-i-closed-3F
Comment