Skip to content

nickbdyer/inject-rewrite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inject-Rewrite

Code Climate Test Coverage

Week 2 Challenge at Makers Academy

This challenge demonstrates use of Ruby and Rspec.

Tasks

  • Rewrite using Iterators
  • Rewrite using Recursion

Improvements

In a preliminary review of this project with a coach, I was told that I have approached this problem incorrectly. I should have re-written the method by breaking it down in to several other smaller methods, like I would normally do in larger projects. I had interpreted the task as a test to make inject as one singular method.

Since the method works correctly in it's current state, I have chosen to leave it as it is for now, as a testament to the time it took to create it!

If I were to refactor it, I would start by taking out the initial states into multiple methods, i.e. when the arg is a symbol, when the arg is an initial value and a symbol, etc. These setup sections are the more complicated sections of the code, and are currently not very readable.

Given some time, I will try to do this re-write in an OOP style.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages