Ruby, Part 2 of 6: Variables and Data Structures

Ruby, Part 2 of 6: Variables and Data Structures

LearnNow Online
Updated Aug 15, 2018

Course description

In this course, Ruby expert Jordan Hudgens examines the basic building blocks of the program and dives deep on its various data structures such as arrays. He will also discuss how Ruby uses dynamic typecasting and teach you how to use the struct class to encapsulate data with methods and behaviors. With a better understanding of data structures in place, Hudgens will then walk you through how to automate tasks in Ruby such as calculating sums.

Each LearnNowOnline training course is made up of Modules (typically an hour in length). Within each module there are Topics (typically 15-30 minutes each) and Subtopics (typically 2-5 minutes each). There is a Post Exam for each Module that must be passed with a score of 70% or higher to successfully and fully complete the course.


You should be familiar with basic text editing in a Windows or Linux environment. No prior knowledge of programming is assumed.

Meet the expert

Jordan Hudgens

Jordan Hudgens has certifications for Ruby on Rails, Thinkful; Ruby on Rails,; Front End Development, Thinkful; and AngularJS, Thinkful. He is currently vice president of engineering for TRACKR in Midland, Texas and is working on his PhD in Computer Science from Texas Tech. In addition to Ruby, Jordan works with PHP, JavaScript, MySQL, Postgres, CSS3, C, C++, C#, Objective-C, and Python. He also works with the frameworks Rails (Ruby), Zend (PHP), and Django (Python), plus the libraries AngularJS, jQuery, and Backbone.js.

Video Runtime

107 Minutes

Time to complete

414 Minutes

Course Outline

Variables and Data Structures

Variables (21:51)

  • Introduction (00:24)
  • Dynamic Data Types (02:35)
  • Demo: Declaring Variables (06:21)
  • Variable Type Casting (02:11)
  • Demo: Type Casting (04:23)
  • Variable Scope (01:25)
  • Demo: Variable Scope (04:09)
  • Summary (00:20)

Arrays and Structs (21:42)

  • Introduction (01:09)
  • Arrays (07:01)
  • Demo: Arrays (04:49)
  • Structs (03:36)
  • Demo: Structs (04:45)
  • Summary (00:18)

Hashes (17:49)

  • Introduction (00:19)
  • Hashes (04:24)
  • Demo: Create a Hash (05:50)
  • Hash Methods (02:18)
  • Demo: Hash Methods (04:36)
  • Summary (00:20)

Loops and Enumerable Methods

Loops (23:13)

  • Introduction (00:18)
  • While Loop (02:39)
  • Demo: While Loop (02:55)
  • Each Loop (04:25)
  • Demo: Each Loop (06:10)
  • Generic Loop (02:32)
  • Demo: Generic Loop (03:59)
  • Summary (00:13)

Map, Inject, and Permutation (22:33)

  • Introduction (00:19)
  • Map and Collect (03:38)
  • Demo: Map (05:13)
  • Inject and Reduce (03:15)
  • Demo: Inject (04:08)
  • Permutation (02:36)
  • Demo: Permutation (03:04)
  • Summary (00:17)