History and Code

Emily Deans
Aug 23, 2017 · 2 min read

Last night’s readings covered some fundamental Ruby concepts, and broke down several foundational components of working in Ruby. A few key/value (sorry 🤓) take-aways:

Classes:

  • Can be thought of as a blueprint/template for objects
  • Determine the structure and functionality of the objects they contain
  • Offer a way to produce many objects that contain different data but share behavior — thus preventing redundant/excessive code
  • You can define methods on a class

Objects:

  • As I’ve mentioned previously, Ruby is an Object-Oriented language, and everything in the language is an object
  • Contain data and instance variables and can take methods
  • Every object has a unique id
  • You can instantiate an object with data (using the ‘initialize’ method), which will accept the data as arguments

Methods:

  • Sets of existing code functionality that can act on a Ruby object
  • Almost everything in Ruby is a method call
  • Certain methods can perform meta-programming — basically, the ability for code to write more code during runtime

We also touched on importing and exporting text and CSV files and worked on a few daily activities that required us to work within the imported files to pull out specific information to work with.

Today’s daily project has us working with text files for the Emancipation Proclamation and the Seneca Falls Convention Declaration of Sentiments, and a little history with your code never hurt anybody…

Song of the Day:Grinder” by Gary Clark Jr.

)

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade