Learn your way! Get started

Ruby, Part 4 of 6: Conditionals and Blocks

with expert Jordan Hudgens


Watch trailer


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 7/15/2016
Level Beginner
Runtime 1h 47m
Closed captioning Included
Transcript Included
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



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.

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.

Learning Paths

This course is part of the following LearnNowOnline SuccessPaths™:
Ruby Development

Meet the expert

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.

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)