class Geometry::Rectangle
Attributes
length[RW]
width[RW]
Public Class Methods
new(length, width)
click to toggle source
# File lib/geometry-mf.rb, line 33 def initialize(length, width) @length = length @width = width end
Public Instance Methods
area()
click to toggle source
# File lib/geometry-mf.rb, line 42 def area @length * @width end
perimeter()
click to toggle source
# File lib/geometry-mf.rb, line 38 def perimeter @length + @length + @width + @width end