Sha256: d9e38d45d625b619dcab33d688f4e477a482fd301c86c146ae3f69bf2931ce67

Contents?: true

Size: 516 Bytes

Versions: 1

Compression:

Stored size: 516 Bytes

Contents

require "str_helper_wdj/version"
require "str_helper_wdj/greeting"

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-1.0.0 lib/str_helper_wdj.rb