Class: String

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

Instance Method Summary collapse

Instance Method Details

#charsObject



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

def chars
  split('')
end

#each_char(&b) ⇒ Object



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

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

#rand_atObject



81
82
83
# File 'lib/charlie/etc/monkey.rb', line 81

def rand_at
  self[rand(size)]
end

#rand_indexObject



77
78
79
# File 'lib/charlie/etc/monkey.rb', line 77

def rand_index
  rand(size)
end