module WordsWithJared
Constants
- VERSION
Public Class Methods
casify(str)
click to toggle source
# File lib/words_with_jared.rb, line 8 def self.casify(str) # symbols -- methods preceded by colons? to_case = [:upcase, :downcase] arr = str.split('') arr.each_with_index do |letter, i| this_case = to_case.sample arr[i] = letter.send(this_case) end arr.join("") end
reversify(str)
click to toggle source
# File lib/words_with_jared.rb, line 4 def self.reversify(str) str.split('').reverse.join('') end
spacify(str, spaces = 0)
click to toggle source
# File lib/words_with_jared.rb, line 19 def self.spacify(str, spaces = 0) spaces.times do str = str.split("").join(" ") end str end