Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # File: triangle.rb
- #
- class Triangle
- def initialize(first:, second:, third:)
- @first = first
- @second = second
- @third = third
- end
- def draw(width:, height:)
- puts "I am a triangle and I will draw myself within the area with width: #{width} and height #{height}"
- puts "My first point is #{first}, my second point is #{second} and my third point is #{third}"
- end
- private
- attr_reader :first, :second, :third
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement