Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Animal
- attr_accessor :species, :breed
- def initialize(species, breed)
- @species = species
- @breed = breed
- end
- def output_animal
- puts "This #{@species} is a #{@breed}"
- end
- end
- animal = Animal.new(:dog, :pitbull)
- animal.species = :horse
- animal.breed = :friesian
- animal.output_animal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement