February 25 - Validating the Length of Each Array Element in Ruby
This guide explains how to validate the length of every element in an Array in Ruby.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
  • Complete the Exercise
Video locked
This video is viewable to users with a Bottega Bootcamp license

Summary

Build a method that validates the length of every element of an Array in Ruby.

Exercise Description

Implement a method that ensures that all of the elements in a Ruby array are a certain length.

Sample Input

%w{words that have size requirements} # validate that all strings are at least 4 characters long

Expected Output

true

Real World Usage

This is a common Ruby interview question, specifically, this will test your knowledge of how to filter through an array for specific lengths.

Test Cases

Code File