Last active
April 2, 2018 08:10
-
-
Save mgiagante/3c23ae5cd542bf6af8885c4c1aa084f3 to your computer and use it in GitHub Desktop.
Class definition an instantiation example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Dog | |
def initialize(name) | |
@name = name | |
end | |
def bark | |
puts "woof!" | |
end | |
end | |
my_dog = Dog.new("Gabe") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment