Skip to content

Instantly share code, notes, and snippets.

@kfitzpatrick
Created January 10, 2010 04:25
Show Gist options
  • Save kfitzpatrick/273332 to your computer and use it in GitHub Desktop.
Save kfitzpatrick/273332 to your computer and use it in GitHub Desktop.
Example 1:
function add(oneNumber, anotherNumber){
return (oneNumber + anotherNumber);
}
add(3,4);
-----------
Example 2:
class WheelSet
def turn!
# do some stuff
end
end
class Vehicle
def initialize
@wheels = WheelSet.new
end
end
class Car < Vehicle
def drive!
@wheels.turn!
end
def go
drive!
end
end
my_car = Car.new
my_car.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment