- See more at: http://blogtimenow.com/blogging/automatically-redirect-blogger-blog-another-blog-website/#sthash.YsVbCxL0.dpuf Journey to Becoming a Web Developer: Modules, Hashes, and Classes

Thursday, October 24, 2013

Modules, Hashes, and Classes

Today I learned about modules and testing in Ruby on Treehouse and on Codecacademy I learned more about Hashes and Classes. I also did some of the Extra Credit exercises on Treehouse. Some of the key things I learned today:

Modules
  • Modules are similar to Classes, but modules only can use methods and constants. 
  • Module uses extend and include to modify classes and objects.
Hashes and Classes
  • Hashes can use symbols instead of strings to identify keys ex(:one => 1)
  • We can convert symbols to strings and vice versa buy using the methods .to_sym and .to_s.
  • We must use and initialize method in a class. It boots up the objects that the class creates.
  • Can create and instance of a class by calling new on the class name. An instance variable is attached to the instance of that class hence its name.
Tomorrow I plan on going through Chris Pine's book "Learn to Program". That is all for now.

No comments:

Post a Comment