Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/charlie/etc/monkey.rb

Instance Method Summary collapse

Instance Method Details

#charsObject



93
94
95
# File 'lib/charlie/etc/monkey.rb', line 93

def chars
  split('')
end

#each_char(&b) ⇒ Object



97
98
99
# File 'lib/charlie/etc/monkey.rb', line 97

def each_char(&b)
  chars.each(&b)
end

#rand_atObject



89
90
91
# File 'lib/charlie/etc/monkey.rb', line 89

def rand_at
  self[rand(size)]
end

#rand_indexObject



85
86
87
# File 'lib/charlie/etc/monkey.rb', line 85

def rand_index
  rand(size)
end