class PolymorphicShape::Rectangle

Attributes

height[RW]
width[RW]

Public Class Methods

new(height, width) click to toggle source
# File lib/shape/polymorphic_shape/rectangle.rb, line 4
def initialize(height, width)
  @height = height
  @width = width
end

Public Instance Methods

area() click to toggle source
# File lib/shape/polymorphic_shape/rectangle.rb, line 9
def area
  @height * @width
end