Skip to content

Instantly share code, notes, and snippets.

@matoni109
Created October 24, 2020 01:40
Show Gist options
  • Save matoni109/d56f0beae964315b1f99c57f3c10d7be to your computer and use it in GitHub Desktop.
Save matoni109/d56f0beae964315b1f99c57f3c10d7be to your computer and use it in GitHub Desktop.
class Animal
def name(name)
@name = name
# TODO: what should this method return?
self
end
def species(species)
@species = species
# TODO: what should this method return?
self
end
def color(color)
@color = color
# TODO: what should this method return?
self
end
def natural_habitat(natural_habitat)
@natural_habitat = natural_habitat
# TODO: what should this method return?
self
end
def to_s
"Name: #{@name}, Species: #{@species}, Color: #{@color}, Natural Habitat: #{@natural_habitat}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment