Skip to content

Instantly share code, notes, and snippets.

@beccasaurus
Created July 25, 2008 02:31
Show Gist options
  • Save beccasaurus/2364 to your computer and use it in GitHub Desktop.
Save beccasaurus/2364 to your computer and use it in GitHub Desktop.
class Dog
attr_accessor :name, :breed
def initialize options = {}
options.each {|k,v| instance_variable_set "@#{k}", v }
end
def bark
puts "woof! my name is #{name} and i am a #{breed}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment