Skip to content

Instantly share code, notes, and snippets.

@mrkcor
Created December 1, 2011 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrkcor/1415675 to your computer and use it in GitHub Desktop.
Save mrkcor/1415675 to your computer and use it in GitHub Desktop.
Example
class Dog
def bark
puts "Woof"
end
end
class Dog
def name=(name)
@name = name
end
def tell_name
puts "This dog is named #{@name}"
end
def assign_name_and_tell_name(name)
self.name = name
tell_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment