Skip Navigation Links

Course Length:
3 Days
Course Description:
This course covers the fundamental components of the Ruby Programming Language. Emphasis is placed on the object oriented aspects of Ruby. Topics include arrays, hashes, regular expressions, io, exceptions, modules, and applications areas.
Who Should Attend:
This course is intended primarily for those who have programmed in other programming languages such as, but not limited to, C, C++, Java, or Perl.
Benefits of Attendance:
Upon completion of this course, students will be able to:
  • Distinguish and use various Ruby datatypes
  • Master the use of arrays and hashes
  • Build home grown classes
  • Use the extensive pre bundled classes
  • Use the I/O facilities of Ruby to read and write binary and text files
  • Master the use of Iterators to loop through various data structures
  • Use Exceptions in handling various run time errors
  • Create Ruby modules
  • Use the wide variety of Ruby Modules that come with the Ruby distribution
Prerequisites:
Students should have taken the Software Development for Non-Programmers course or have at least six months of programming experience in at least one programming language.
Course Outline:
  • Chapter 1: An Overview Of Ruby (Part 1)
    1. What is Ruby?
    2. Executing Ruby Code
    3. Getting Input
    4. Comments
    5. Numbers
    6. Strings
    7. The Class Class
    8. Decision Making
    9. The case Construct
    10. Loops
    11. Iterators
    12. Regular Expressions
    13. Functions
    14. Odds and Ends
    15. Time Methods
  • Chapter 2: An Overview of Ruby (Part 2)
    1. Arrays
    2. Array Operator Methods
    3. Array Equality Operator
    4. Arrays as Stacks and Queues
    5. Higher Dimensional Arrays
    6. Other Useful Arrays Methods
    7. Command Line Arguments
    8. Hashes
    9. Common Hash Methods
    10. Sorting Hashes
    11. Iterators with Arrays and Hashes
    12. Arrays and Functions
    13. Hashes and Functions
    14. Named Parameters
    15. Symbols
    16. Procs
    17. Closures
  • Chapter 3: Classes
    1. Objects
    2. Brief History of OOP
    3. OOP Vocabulary
    4. Creating a New Class
    5. Using Objects
    6. Defining Operator Methods
    7. Inheritance
    8. Ancestors
    9. self
    10. Access Levels - public
    11. Access Levels – private
    12. Access Levels - protected
    13. Access Levels - Specification
    14. Class Data and Class Methods
    15. Adding Methods to Classes and Objects
    16. Special Global Variables
    17. Scope of Variables
    18. Built-in Classes
    19. The Math Class
    20. The NilClass Class
    21. TrueClass and FalseClass
    22. Built-in Class Hierarchy
  • Chapter 4: Input and Output
    1. Introduction
    2. Reading from the Standard Input
    3. Reading a Character at a Time
    4. Writing to the Standard Output
    5. Reading and Writing Disk Files
    6. Reading Files Using Iterators
    7. I/O With Command Line Commands
    8. Seeking About Files
    9. tell
    10. Capturing Data About Files
    11. Processing Directories
  • Chapter 5: Exceptions
    1. Introduction
    2. Exceptions
    3. Handling Exceptions
    4. Multiple Rescue Clauses
    5. Exceptions are Classes
    6. ensure
    7. retry
    8. raise
    9. Creating Your Own Exceptions
    10. catch and throw
  • Chapter 6: Modules
    1. Introduction
    2. Using Core Ruby Classes
    3. Ruby Standard Library
    4. require
    5. Search Path
    6. File Organization
    7. Load
    8. Modules
    9. include
    10. Mixins
    11. Using the Comparable Module
    12. Collection Classes
    13. yield
    14. Using the Enumerable Module
  • Chapter 7: Odds and Ends
    1. Ruby Conventions
    2. Strings Are References
    3. The Selection Operator, [ ]
    4. Index Methods
    5. Stripping Whitespace Characters
    6. Bit Manipulation
    7. The upto Method
    8. Substituting
    9. Processing a Line at a Time
    10. Marshalling
    11. Reflection
    12. grep
    13. Classes are Objects
    14. Aliasing
    15. Testing
    16. Test::Unit
    17. Testing Your Own Classes
    18. Freezing Objects