How to List Directory in Ruby - Code Snippet

How to perform 'List Directory' in Ruby.

example.rb
# Task: List Directory
# Language: Ruby

def list_directory() 
    # Implementation for List Directory
    # TODO: Implement core logic here
    # Step 1: Prepare data
    # Step 2: Process List Directory
    puts("Done");
end
AdSense Slot