> For the complete documentation index, see [llms.txt](https://certil-remy.gitbook.io/learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://certil-remy.gitbook.io/learn/oop-ruby/untitled-4.md).

# Meowing Cat

## Meowing Cat

### Objectives

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

[![maru in a box](https://camo.githubusercontent.com/e1bdda13405870d2341caa881fb767ba9b585ac1/687474703a2f2f726561646d652d706963732e73332e616d617a6f6e6177732e636f6d2f74756d626c725f6c6d3834316d6a45647a317169627870346f315f3530302e6a7067)](https://camo.githubusercontent.com/e1bdda13405870d2341caa881fb767ba9b585ac1/687474703a2f2f726561646d652d706963732e73332e616d617a6f6e6177732e636f6d2f74756d626c725f6c6d3834316d6a45647a317169627870346f315f3530302e6a7067)

### 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.

View [Meowing Cat](https://github.com/learn-co-curriculum/oo-meowing-cat) on Learn.co and start learning to code for free.
