Skip to content

Instantly share code, notes, and snippets.

@rachaelsalter
Created August 15, 2015 02:27
Show Gist options
  • Save rachaelsalter/899243e839b56ca1f149 to your computer and use it in GitHub Desktop.
Save rachaelsalter/899243e839b56ca1f149 to your computer and use it in GitHub Desktop.
class PBJ
attr_accessor :pbutter, :jelly
def initialize(pbutter, jelly)
@pbutter = pbutter
@jelly = jelly
end
def make
puts "Spread #{@pbutter} peanut butter and #{@jelly} jelly on bread. Bam!"
end
end
sandwhich = PBJ.new(:crunchy, :strawberry)
sandwhich.jelly = :apricot
sandwhich.make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment