module StrHelpersAndrew

Constants

VERSION

Public Class Methods

casify(str) click to toggle source
# File lib/str_helpers_andrew.rb, line 9
def self.casify(str)
  to_case = [:upcase, :downcase]
  array = 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/str_helpers_andrew.rb, line 5
def self.reversify(str)
  str.split("").reverse.join('')
end
spacify(str, spaces = 0) click to toggle source
# File lib/str_helpers_andrew.rb, line 20
def self.spacify(str, spaces = 0)
  new_string = str
  spaces.times do
    new_string = new_string.split('').join(' ')
  end

  new_string
end