class Geometry::Rectangle

Attributes

length[RW]
width[RW]

Public Class Methods

new(length, width) click to toggle source
# File lib/geometry-befr.rb, line 61
def initialize(length, width)
  @length = length
  @width = width
end

Public Instance Methods

area() click to toggle source
# File lib/geometry-befr.rb, line 66
def area
  @length * @width
end
perimeter() click to toggle source
# File lib/geometry-befr.rb, line 70
def perimeter
  (@length * 2) + (@width * 2)
end