Sha256: 5a5ac27f74d111b1522e2181ec9a5d5aba3fa9e4e9bcd0dd7bff0b9903b6df14
Contents?: true
Size: 549 Bytes
Versions: 4
Compression:
Stored size: 549 Bytes
Contents
require "str_helpers_dave/version" require "str_helpers_dave/greeting" module StrHelpersDave 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
4 entries across 4 versions & 1 rubygems