Created
November 27, 2013 23:24
-
-
Save justuseapen/7684821 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Circle | |
def initialize(radius) | |
@radius = radius | |
end | |
def diameter | |
@diameter = @radius * 2 | |
end | |
def circumference | |
Math::PI*@diameter | |
end | |
def area | |
Math::PI*@radius**2 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment