Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. # File: square.rb
  2. #
  3. class Square < Shape
  4. def initialize(top_left:, bottom_right:)
  5. @top_left = top_left
  6. @bottom_right = bottom_right
  7. end
  8.  
  9. def draw(width:, height:)
  10. super
  11. puts "My top left corner is #{top_left} and my bottom right corner is #{bottom_right}"
  12. end
  13.  
  14. private
  15.  
  16. attr_reader :top_left, :bottom_right
  17. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement