Skip to content

Commit

Permalink
bug in class_super.rb fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthikeyan A K committed Apr 26, 2016
1 parent 7dddaff commit 9b8dc2d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions class_super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
# class_super.rb

class Rectangle

def set_dimension length, breadth
@length, @breadth = length, breadth
end

def area
@length * @breadth
end

end


class Square < Rectangle

def set_dimension side_length
super side_length, side_length
end

end

square = Square.new
square.set_dim 7
square.set_dimension 7
puts "Area: #{square.area}"

0 comments on commit 9b8dc2d

Please sign in to comment.