8000 GitHub - dominicchapman/oo-meowing-cat-cb-gh-000 at solution · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

33 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meowing Cat

Objectives

  1. Practice defining a class
  2. Use macros to create setter and getter methods

maru in a box

Introduction

In this lab, you'll be creating a Cat class. Every instance of a Cat should have a name and be able to meow. In other words, I should be able to do:

maru = Cat.new
maru.name = "Maru"

maru.name
# => "Maru"

maru.meow
# "meow!"
# => nil

Instructions

Run the test suite to get started. You'll be writing all your code in the lib/meowing_cat.rb file.

  1. Define a class, called Cat.
  2. Use the attr_accessor macro to create a setter and getter method for a cat's name.
  3. Write a method, .meow, that outputs "meow!" to the terminal using the puts method when called on an instance of Cat.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0