Sha256: 2fec1b247f00d9e4eac1f752c9441826c3749c5e0732e30ae35ff48db830e2ce

Contents?: true

Size: 566 Bytes

Versions: 1

Compression:

Stored size: 566 Bytes

Contents

require "str_methods_djungst/version"
require "str_methods_djungst/greeting"

module StrMethodsDjungst
  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[rand(2)]
      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
str_methods_djungst-1.1.0 lib/str_methods_djungst.rb