Twitter Updates

Saturday, 29 November 2008

Ruby Variables

Just brushing up on Ruby from the cartoon fox who loves chunky bacon. Chapter 3 introduces so many types of variables, here is my quick summary of ruby variables.

something = "A string"
something2 = 'Another string'

somthing3 = 1

something4 =3.14

#Symbols (light weight strings)

#Constants (Capitalized)
SOMETHING = "This can never be changed"

#Global Variables (dollar sign)

#Instance Variables

'Class Variables

#Calling methods
objectInstance.add( :red ) , objectInstance.remove( :blue)

eg Object::new() , Object::killall

No comments: