tiy-houston-q1-rails / day-3

Classes (data + behavior)
0 stars 0 forks source link

Day 3 - Classes

MINISWAN -- Matz is the creator of Ruby

Goals

  1. Scope
  2. Classes
  3. Inheritance
  4. Initialize
  5. Instance Variables
class Person
  def initialize(first_name, last_name)
    @first_name = first_name
    @last_name = last_name
  end

  def full_name
    [@first_name, @last_name].join(" ")
  end
end

jwo = Person.new("jesse", "wolgamott")
jwo.full_name
=> "jesse wolgamott"

Assignment

Robot

BendingUnit

ActorUnit