Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. class Animal
  2. attr_accessor :species, :breed
  3. def initialize(species, breed)
  4. @species = species
  5. @breed = breed
  6. end
  7.  
  8. def output_animal
  9. puts "This #{@species} is a #{@breed}"
  10. end
  11. end
  12.  
  13. animal = Animal.new(:dog, :pitbull)
  14. animal.species = :horse
  15. animal.breed = :friesian
  16. animal.output_animal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement