Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def self.create_with_attributes (noise, color)
- animal = Animal.new(noise) # or use animal = self.new(noise)
- animal.color = color
- return animal
- end
- # Is the same as ?
- def self.create_with_attributes (noise, color)
- animal = Animal.new
- animal.noise = noise
- animal.color = color
- return animal
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement