Advertisement
AngryPacman

Ham and Cheese Sandwich

Feb 11th, 2012
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.26 KB | None | 0 0
  1. class Sandwich
  2.   attr_accessor :fillings
  3.   def initialize(fillings = nil, *a); @fillings = fillings; end
  4. end
  5.  
  6. class Person
  7.   attr_accessor :sandwich
  8.   def initialize(*a); @sandwich = nil; end
  9. end
  10.  
  11. aco = Person.new
  12. aco.sandwich = Sandwich.new([:ham, :cheese])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement