Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. class Dog
  2. attr_accessor :breed, :color
  3.  
  4. def initialize (breed, color)
  5. @breed = breed
  6. @color = color
  7. end
  8.  
  9. def output_dog
  10. puts "a #{@color} #{@breed} is a dog"
  11. end
  12.  
  13. end
  14.  
  15. dog = Dog.new(:lab, :black)
  16. puts dog
  17. dog.output_dog
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement