class Geometry::Rectangle

Attributes

l[RW]
w[RW]

Public Class Methods

new(l, w) click to toggle source
# File lib/geometry-mc.rb, line 55
def initialize(l, w)
        @l = l
        @w = w
end

Public Instance Methods

area() click to toggle source
# File lib/geometry-mc.rb, line 64
def area
        @l * @w
end
perimeter() click to toggle source
# File lib/geometry-mc.rb, line 60
def perimeter
        2 * (@l + @w)
end