Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Ruby | Enumerable entries() function

  • Last Updated : 05 Dec, 2019

The entries() of enumerable is an inbuilt method in Ruby returns the items in the enumerable.

Syntax: enu.entries

Parameters: The function does not takes any parameter.

Return Value: It returns the items in the enum.

Example 1:






# Ruby program for entries method in Enumerable
  
# Initialize 
enu = [7, 9, 10]
  
# Prints each with object
enu.entries

Output:

[7, 9, 10]

Example 2:




# Ruby program for entries method in Enumerable
  
# Initialize 
enu = (7..14)
  
# Prints each with object
enu.entries

Output:

[7, 8, 9, 10, 11, 12, 13, 14]
My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!