Class: Geometry::Circle
- Inherits:
-
Object
- Object
- Geometry::Circle
- Defined in:
- lib/geometrize.rb
Overview
end class rect
Instance Attribute Summary collapse
-
#f ⇒ Object
Returns the value of attribute f.
Instance Method Summary collapse
- #area ⇒ Object
- #circumference ⇒ Object
-
#initialize(f) ⇒ Circle
constructor
A new instance of Circle.
Constructor Details
#initialize(f) ⇒ Circle
Returns a new instance of Circle.
63 64 65 |
# File 'lib/geometrize.rb', line 63 def initialize(f) @f = f end |
Instance Attribute Details
#f ⇒ Object
Returns the value of attribute f.
61 62 63 |
# File 'lib/geometrize.rb', line 61 def f @f end |
Instance Method Details
#area ⇒ Object
71 72 73 |
# File 'lib/geometrize.rb', line 71 def area 3.14159265359 * @f * @f end |
#circumference ⇒ Object
67 68 69 |
# File 'lib/geometrize.rb', line 67 def circumference 2 * 3.14159265359 * @f end |