« Back to blog

My Ruby Notes

[This post will be my Ruby Notes which i will keep updating. It is more like a personal Ruby manual.] Numbers: [sourcecode language="ruby"] population = 12_000_000_000 # means the same thing as population = 12000000000 [/sourcecode] Variables: begins with a small letter => normal variable begins with a capital letter => Constant begins with a $ => Global Variable begins with a : (colon) e.g. :a => Symbol begins with an @ => Instance Variable begins with an @@ => Class Variable in between two |'s e.g. |x| => Block arguments