Show Menu
Cheatography

RCS Cheat Sheet (DRAFT) by

test

This is a draft cheat sheet. It is a work in progress and is not finished yet.

array

Array#clear
Array#map! do |x| ... end
Array#delete (value) -> obj or nil
Array#delete_at (index) -> obj or n
Array#delete_if do |x| ... end
Array#each do |x| ... end
Array#flatten! -> array
Array#include? (value) -> t or f
Array#insert (idx, obj...) -> array
Array#join ([string]) -> string
Array#length -> integer
Array#pop -> obj or nil
Array#push (obj..) -> array
array manipu­lation

Reserved Words

alias
and
BEGIN
begin
break
case
class
def
defined?
do
else
elseif
END
end
ensure
false
for
f
in
module
next
nil
not
or
redo
rescue
retry
return
self
super
then
true
undef
unless
until
when
while
yield
reserve words are not meant to be used as class or variable names
 

String

'no interpolation'
"#{interpolation} and backslashes\n"
%q(no interpolation)
%Q(interpolation and backslashes)
%(interpolation and backslashes)
`echo command interpretation with interpolation and
backslashes`
%x(echo command interpretation with interpolation and
backslashes)
get length of the string and returns an integer value
 

variables

CONSTANT