Sha256: 5f0f443ff1e5f46de5405ae7803a461ecbb8e80b782072295434ed2ba350a971

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

require "words_with_dave/version"

module WordsWithDave
  def self.reversify(str)
    str.split('').reverse.join('')
  end

  def self.casify(str)
    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

  def self.spacify(str, spaces = 0)
    spaces.times do
      str = str.split("").join(" ")
    end
    str
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
words_with_dave-0.3.0 lib/words_with_dave.rb