Object Oriented Programming
Instantiation in Ruby
Used to create an object instance from a class (instantiate).
identifier = className.new(passedParameters)
Input requirements are taken from the constructor. A class can have multiple constructors with different numbers of input parameters and types, to create different objects.
An instance of a class is called an object.
#class definition class Car def initialize(make) @make = make end end #class instantiation myCar = new.Car("Honda")
Class Declaration and Structure