The > is an inbuilt method in Ruby that returns true if a set if a proper superset of another set. If it is not a proper superset, then it returns false.
Syntax: s1.name > s2.name
Parameters: The function does not takes any parameter.
Return Value: It returns true if set s1 is a proper superset of s2, else it returns false.
Example 1:
# Ruby program to illustrate the > method # requires the set require "set" s1 = Set[1, 2] s2 = Set[1, 2, 3] # > method used puts s1 > s2 |
chevron_right
filter_none
Output:
false
Example 2:
# Ruby program to illustrate the > method # requires the set require "set" s1 = Set[1, 2, 3, 4] s2 = Set[1, 2, 3] # > method used puts s1 > s2 |
chevron_right
filter_none
Output:
true
Recommended Posts:
- Ruby | Set >= method
- Ruby | Set << method
- Ruby | Set < method
- Ruby | Set + method
- Ruby | Set add() method
- Ruby | Set & method
- Ruby | Set - method
- Ruby | Set <= method
- Ruby | Set replace() function
- Ruby | Set reset() function
- Ruby | Decision Making (if, if-else, if-else-if, ternary) | Set - 1
- Ruby | Exception Handling in Threads | Set - 1
- Ruby | Set merge() function
- Ruby | Set member?() function
- Object-Oriented Programming in Ruby | Set 1
- Ruby | Set include?() function
- Ruby | Set delete? function
- Ruby | Set delete() function
- Ruby | Set compare_by_identity? function
- Ruby | Set compare_by_identity() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

