34,333
edits
Changes
→Defining a Ruby Class
== Defining a Ruby Class ==
For the purposes of this tutorial we will create a new class intended to be used as part of a banking application. Classes are defined using the ''class'' keyword followed by the ''end'' keyword and must be given a name by which they can be referred. This name is a constant so much must begin with a capital letter.
With these rules in mind we can begin work on our class definition: