Check out example codes for "ruby list of files in directory include subfolders". It will help you in understanding the concepts better.

Code Example 1

Dir['**/*']
Dir.glob('**/*')

Learn ReactJs, React Native from akashmittal.com