Advertisement
Guest User

Untitled

a guest
Sep 25th, 2012
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.33 KB | None | 0 0
  1. def self.create_with_attributes (noise, color)
  2.         animal = Animal.new(noise) # or use animal = self.new(noise)
  3.         animal.color = color
  4.         return animal
  5.     end
  6.  
  7. # Is the same as ?
  8.  
  9. def self.create_with_attributes (noise, color)
  10.         animal = Animal.new
  11.                 animal.noise = noise
  12.         animal.color = color
  13.         return animal
  14.     end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement