Skip to content

Instantly share code, notes, and snippets.

@jeffreybaird
Forked from ashleygwilliams/gist:5682375
Last active December 20, 2015 11:19
Show Gist options
  • Save jeffreybaird/6122696 to your computer and use it in GitHub Desktop.
Save jeffreybaird/6122696 to your computer and use it in GitHub Desktop.
#CLASS/INSTANCE METHODS AND VARIABLES PRACTICE:
# ADD YOUR CODE TO THIS FILE
#
#1. Class/Methods
# -create a class called Project
# -create a class variable called count
# -create a instance method called "say_class_name" that prints name of the class
#2.Instance Variables/Class Variables/Constants
# - create a class method to return @@count
# - give it the instance variables title, description, role, date created and date updated
# - create a class constant that holds an array with thenumbers 1-10
#3. make the instance variables accessible by dot notation EXCEPT for date updated
#4. make a instance method called get_date_updated to return date_updated
#5. make an instance method called change_date_updated to change the value of date_updated. this method should print "successfully updated <Project title>."
#6. Describe, in English, with comments, line by line what your program does and why.

###Learning Objectives

  • make a new class
  • access instance variable values
    • using dot notation
    • using instance methods
  • change instance variable values
    • using dot notation
    • using instance methods #e.g. myProject.changeDateUpdated("05 May 1986")
  • access the count of objects created
    • using ::
    • using a class method
  • Be able to describe, in english, how a program works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment