Sha256: 6f9a1f62447822e8b7748fd0bbea13cf1db637cbe0487dcc87ed599cf171b0cd

Contents?: true

Size: 471 Bytes

Versions: 1

Compression:

Stored size: 471 Bytes

Contents

require "str_helper_mw/version"

module StrHelperMw
  
  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
str_helper_mw-0.1.0 lib/str_helper_mw.rb