In Ruby, you can find the size of an array in different ways. Here are some examples:
1. Using the length method:
my_array = [1, 2, 3, 4]
puts my_array.length # Output: 4
2. Using the count method:
my_array = [1, 2, 3, 4]
puts my_array.count # Output: 4
3. Using the size method:
my_array = [1, 2, 3, 4]
puts my_array.size # Output: 4
All of these methods return the number of elements in the array. You can use any of them depending on your preference or coding style, but they all have the same effect.