Sha256: 8619081ae675761e34414ccab805730ac6e8f1b599addb09910efe36e223edc6

Contents?: true

Size: 274 Bytes

Versions: 2

Compression:

Stored size: 274 Bytes

Contents

class String
  ALPHABET = ('a'..'z').to_a
  VOWELS = %w(a e i o u)
  CONSONANTS = ALPHABET - VOWELS

  def namna_sub
    case self
    when '?'
      ALPHABET.sample
    when '*'
      VOWELS.sample
    when '#'
      CONSONANTS.sample
    else
      self
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
namna-0.0.4 lib/namna/string.rb
namna-0.0.3 lib/namna/string.rb