Class: Geometry::Circle

Inherits:
Object
  • Object
show all
Defined in:
lib/geometrize.rb

Overview

end class rect

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fObject

Returns the value of attribute f.



61
62
63
# File 'lib/geometrize.rb', line 61

def f
  @f
end

Instance Method Details

#areaObject



71
72
73
# File 'lib/geometrize.rb', line 71

def area
  3.14159265359 * @f * @f
end

#circumferenceObject



67
68
69
# File 'lib/geometrize.rb', line 67

def circumference
  2 * 3.14159265359 * @f
end