A Quick Tutorial on using Classes in Ruby

A picture of rubies

Creating a Class

Define our Class

Defining a class called Person

Create our reader/writer methods

attr_accessor gives both read and write functionality

Create our Initialize Method

Create Instance Methods

A coding and motorcycle enthusiast who’s passionate about personal development and learning. Recent Flatiron School of Software Engineering graduate.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store