Sha256: a640811722ffdd0e13d42bbb8c4ced4c1d19cda1513ec1c2333c5501c42c88cc

Contents?: true

Size: 482 Bytes

Versions: 1

Compression:

Stored size: 482 Bytes

Contents

require "str_helper_wdj/version"

module StrHelperWdj
  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|
      #:upcase
      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
str_helper_wdj-0.1.0 lib/str_helper_wdj.rb