Ruby

23
1295 reads

March 6, 2013

Symbol Id's


It is a common misconception that a symbol is a type of string. After all, isn’t the symbol, :hello pretty similar to the string, ‚hello‛? In fact, symbols are quite unlike strings.

35
1367 reads

March 6, 2013

Ints and Symbols


Int and Symbol Together

26
1309 reads

March 6, 2013

All Symbols


p( Symbol.all_symbols )

30
1304 reads

March 6, 2013

Why Symbols


Some methods in the Ruby class library specify symbols as arguments. Naturally, if you need to call those methods, you are obliged to pass symbols to them.

22
1154 reads

March 6, 2013

40
1150 reads

March 6, 2013

36
1288 reads

March 5, 2013

Unless


Using Unless

34
1401 reads

March 5, 2013

Negation


Using Not Operator

39
1276 reads

March 5, 2013

Universal Constant


This is how we work with Universal Constants in Ruby

27
1297 reads

March 5, 2013

if unless Modifiers


You may recall the alternative syntax for while loops mentioned in Chapter 5. Instead of writing this< while tired do sleep end