Skip to content

Instantly share code, notes, and snippets.

@matoni109
Created October 24, 2020 01:39
Show Gist options
  • Save matoni109/70813e219ce0139a689823a7b0905e40 to your computer and use it in GitHub Desktop.
Save matoni109/70813e219ce0139a689823a7b0905e40 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
@color
"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