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