Sha256: 64446ce9fecfd4beea8989dbf89da629b909deace4205597c09fcd384396ea81

Contents?: true

Size: 509 Bytes

Versions: 1

Compression:

Stored size: 509 Bytes

Contents

require "wordify_djungst/version"

module WordifyDjungst
  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)
    new_string = str
    spaces.times do
      new_string = new_string.split("").join(" ")
    end
    new_string
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wordify_sorce-0.1.0 lib/wordify_djungst.rb