Ruby, Part 4 of 6: Conditionals and Blocks
Interactive

Ruby, Part 4 of 6: Conditionals and Blocks

LearnNow Online
Updated Aug 23, 2018

Course description

In this course, Ruby expert Jordan Hudgens dives into the topics of conditionals and blocks by exploring the various mechanisms for implementing this type of behavior into an application. He will discuss working with both standard and nested conditionals as well as give a step-by-step guide for using switch statements. Additionally, Hudgens will take a comprehensive look at blocks, giving a step-by-step demonstration on how they are used including reviewing how popular frameworks use them.

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.


Prerequisites

You should be familiar with basic text editing in a Windows or Linux environment. No prior knowledge of programming is assumed. This course builds on the previous ruby courses: Ruby: Introduction and Classes, Ruby: Variables and Data Structures, Ruby: Input/Output and Gems.


Meet the expert

Jordan Hudgens

Jordan Hudgens has certifications for Ruby on Rails, Thinkful; Ruby on Rails, Bloc.io; 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

394 Minutes

Course Outline

Conditionals and Blocks

Standard Conditionals (11:02)

  • Introduction (00:23)
  • Standard (05:49)
  • Demo: Standard Conditional (04:33)
  • Summary (00:16)

Compound Conditionals (09:24)

  • Introduction (00:22)
  • Compound (02:29)
  • Demo: Compound Conditional (02:26)
  • Demo: Conditional Order (03:52)
  • Summary (00:13)

Operators (09:36)

  • Introduction (00:20)
  • Conditional Operators (05:17)
  • Demo: Conditional Operators (03:41)
  • Summary (00:16)

Switch (09:55)

  • Introduction (00:24)
  • Switch Statements (04:10)
  • Demo: Switch Statement (05:00)
  • Summary (00:20)

Guard (10:29)

  • Introduction (00:24)
  • Guard Clauses (03:07)
  • Demo: Guard Clause (06:38)
  • Summary (00:18)

What Are Blocks (09:16)

  • Introduction (00:26)
  • What Are Blocks? (04:01)
  • Demo: Blocks (04:27)
  • Summary (00:20)

Yield (10:07)

  • Introduction (00:21)
  • Yield (04:07)
  • Demo: Yield (05:19)
  • Summary (00:19)

Block Given (13:31)

  • Introduction (00:22)
  • block_given? (02:54)
  • Demo: block_given? (04:49)
  • Demo: Practical Example (05:09)
  • Summary (00:15)

File Class (07:24)

  • Introduction (00:23)
  • File Class with Block (02:33)
  • Demo: File Class (04:11)
  • Summary (00:17)

Yield in Rails (07:23)

  • Introduction (00:21)
  • Yield in Rails (01:55)
  • Demo: Yield in Rails (04:43)
  • Summary (00:22)

Ampersand (09:41)

  • Introduction (00:21)
  • Ampersand Argument (04:06)
  • Demo: Ampersand (04:51)
  • Summary (00:21)
;