Skip to content

amandarichardsonn/kwk-l1-instance-methods-lab-ruby-teachers-l1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Instance Methods Lab Ruby

Objectives

  1. Define a class.
  2. Build instance methods for the class.

Overview

You're going to be adding 2 instance methods to a Dog and Person class.

Instructions

Open this lab with learn open and run your tests with learn.

1. Define Dog in lib/dog.rb

Open lib/dog.rb and add a class definition for a Dog class.

2. Define #bark in Dog

Add an instance method #bark to your Dog class in lib/dog.rb that will puts "Woof!"

3. Define #sit in Dog

Add an instance method #sit to your Dog class in lib/dog.rb that will puts "The Dog is sitting".

4. Define a Person in lib/person.rb

Open lib/person.rb and add a class definition for a Person class.

5. Define #talk in Person

Add an instance method #talk to your Person class in lib/person.rb that will puts "Hello World!"

6. Define #walk in Person

Add an instance method #walk to your Person class in lib/person.rb that will puts "The Person is walking".

When you're done, submit the lab with learn submit.

KWK-L1 Instance Methods Lab Ruby

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%