jcolebot / ruby_template

Basic MadLib Program in Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ruby_template

A MadLib Program in Ruby with RSpec testing. Designed to easily take template and replace any words enclosed in brackets.

The [animal] jumped over the [planetary body] Should ask for a animal Should ask for a planetary body Should be able to replace the two items in [] with whatever is given by the "user"

Have a template => Make a template class Know what words in the template are replacable => Maybe have a function that gives me a list of replacable words => This will return an array of strings => If the template is "The [animal] jumped over the [planetary body]" => The result of this function should be ["animal", "planetary body"] Replace those words => Maybe have a function where I give it a list of replacements and it gives me the final filled in template

About

Basic MadLib Program in Ruby


Languages

Language:Ruby 100.0%