Ruby Programming
Revision: TE3601_20080501
(7.29 KB) View, Download, or Print Catalog as a PDF.
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 such as CGI, client/server, and network programming.
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
- Use Ruby to write CGI programs
- Write client/server apps using Ruby
- Write Graphical User Interfaces in Ruby
Prerequisites:
Students should have at least six months of programming experience in at least one programming language.
Course Outline:
- Chapter 1: An Overview Of Ruby
- What is Ruby?
- Ruby History
- The Ruby Interactive Shell
- Language Components
- Numbers
- Simple Input and Output
- Strings
- The Class Class
- Comments
- Loops
- Arrays
- Hashes
- Iterators with Arrays and Hashes
- Decision Making
- Regular Expressions
- The case Construct
- Functions
- Object Orientation in Ruby
- Command Line Arguments
- Symbols
- Using Hashes as Function Arguments
- Odds and Ends
- Chapter 2: Classes
- Defining a New Class
- Class Creation
- Using Objects
- Defining Operator Methods
- Inheritance
- self
- Access Levels - public
- Access Levels - private
- Access Levels - protected
- Access Levels - Specification
- Class Data and Class Methods
- Variables and Scope
- Special Global Variables
- Documentation
- Built-in Classes
- Chapter 3: Input and Output
- I/O
- Reading from the Standard Input
- Writing to the Standard Output
- Reading and Writing Disk Files
- Reading Files Using Iterators
- Capturing Data About Files
- Processing Directories
- Chapter 4: Exceptions
- Introduction
- Exceptions
- Handling Exceptions
- Multiple Rescue Clauses
- Exceptions Are Classes
- ensure
- retry
- raise
- Creating Your Own Exceptions
- catch and throw
- Chapter 5: Modules
- Introduction
- Disambiguation of Libraries
- Modules
- Mixins
- Using the Comparable Module
- yield
- Using the Enumerable Module
- Proc Objects
- Closures
- File Organization
- Chapter 6: Strings
- Review
- Strings Are References
- The Selection Operator, [ ]
- Index Methods
- Numerical Methods
- squeeze
- dump
- concat
- The upto Method
- Substituting
- Processing a Line at a Time
- Chapter 7: Applications Areas
- An Introduction to CGI
- An HTML Front-End
- HTML Rendering
- Contacting the Server
- Server Issues
- The CGI Program
- CGI Output
- Reading Files
- Exercises
- Chapter 8: Graphical User Interfaces
- Event Driven Programming
- The Button Widget
- More Widgets
- TkEntry
- TkRadioButton
- TkCheckButton
- TkText
- A Calculator Example
- Chapter 9: Rails
- What is Rails?
- Using Gem
- Starting With Rails
- Model View Controller
- URL Requests in Rails
- Embedded Ruby
- Linking Pages Together
- Kick Starting a Rails App
- Summary
- Appendix A: Date Classes
- Telling Time
- Date Objects
- DateTime
- ParseDate
- strftime



