Sha256: f332e0455aa444d9850e029db85b6d0a3d3203deb456613a73fd7f1b4fd0c492

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

require "words_with_jared/version"

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

  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

  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_jared-0.2.0 lib/words_with_jared.rb