- 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 Introduction to Ruby
- What is Ruby?
- Installing Ruby
- Executing Ruby Code
- Getting Help
- Dynamic Types
- Ruby Reserved Words
- Naming Conventions
- Comments
- Chapter 2: Standard Ruby Data Types
- Numbers
- Strings
- Simple Input and Output
- Converting String Input
- Regular Expressions
- Time Methods
- Chapter 3: Language Components
- The if Statement
- The case Construct
- Loops
- Iterators
- Numeric Iterators
- String Iterators
- Methods
- Odds and Ends
- Chapter 4: Collections
- Arrays
- Array Operator Methods
- Array Equality Operator
- Arrays as Stacks and Queues
- Higher Dimensional Arrays
- Other Useful Arrays Methods
- Command Line Arguments
- Hashes
- Common Hash Methods
- Sorting Hashes
- Iterators with Arrays and Hashes
- Arrays and Methods
- Hashes and Methods
- Named Parameters
- Symbols
- Procs
- Closures
- Chapter 5: Classes
- Objects
- Brief History of OOP
- OOP Vocabulary
- Creating a New Class
- Using Objects
- Defining Operator Methods
- Inheritance
- Ancestors
- self
- Access Levels - public
- Access Levels – private
- Access Levels - protected
- Access Levels - Specification
- Class Data and Class Methods
- Adding Methods to Classes and Objects
- Special Global Variables
- Scope of Variables
- Built-in Classes
- The Math Class
- The NilClass Class
- TrueClass and FalseClass
- Built-in Class Hierarchy
- Chapter 6: Input and Output
- Introduction
- Reading from the Standard Input
- Reading a Character at a Time
- Writing to the Standard Output
- Reading and Writing Disk Files
- Reading Files Using Iterators
- I/O With Command Line Commands
- Seeking About Files
- tell
- Capturing Data About Files
- Processing Directories
- Chapter 7: Exceptions
- Introduction
- Exception Hierarchy
- Handling Exceptions
- Multiple Rescue Clauses
- Exceptions are Classes
- ensure
- retry
- raise
- Creating Your Own Exceptions
- catch and throw
- Chapter 8: Modules
- Introduction
- Using Core Ruby Classes
- Ruby Standard Library
- require
- Search Path
- File Organization
- load
- Modules
- include
- Mixins
- Using the Comparable Module
- Collection Classes
- yield
- Using the Enumerable Module
- Chapter 9: Odds and Ends
- Ruby Conventions
- Bit Manipulation
- Substituting
- Marshalling
- Reflection
- grep
- Classes are Objects
- Aliasing
- Testing
- Test::Unit::TestCase
- Testing Your Own Classes
- Freezing Objects
- Chapter 1: An Introduction to Ruby


















