Skip to content

Instantly share code, notes, and snippets.

kaiwren/rbmonk-class-example.rb
class Rectangle
def initialize(length, breadth)
@length = length
@breadth = breadth
end
def perimeter
2 * (@length + @breadth)
end
def area