Create a Range of Months Using the Ruby Date Library

0
3230

This coding exercise is deceptively easy. The goal is to implement a method that returns an array with the full set of month names. However in order to properly build the solution you’ll need to use the Ruby Date library.

Summary

Implement a method that returns an array of month names.

Exercise File

Code File

Exercise Description

This may seem like an easy exercise, however in order to properly pass this exercise you have to utilize the Ruby Date library. You cannot simply type out an array with the month names.

Expected Output

["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]

Real World Usage

This exercise will test your ability to work with the Ruby Date library. Additionally, the solution walks through two solutions, one that shows how to build the method from scratch and another that performs the work automatically.

Solution

Can be found on the solutions branch on github.

LEAVE A REPLY

Please enter your comment!
Please enter your name here