January 30, 2017
Ruby Training Syllabus:
• What is Ruby?
• What is it used for?
• The Command Prompt
• Installing Ruby
• Running Ruby
• Ruby Documentation: RDoc and ri
• Ruby Is an Object-Oriented Language
• Some basic Ruby
• Arrays and Hashes
• Control Structures
• Regular Expressions
• blocks and Iterators
• Reading and Writing
basic Ruby Language Elements
• Structure of statements and comments.
• Variables and constants.
• Assignments and calculations
• Integer, float and string formats.
• Single and double quotes
• Here documents, general strings
• blocks and the if statement.
• Writing conditions.
• Comparative, boolean and range operators.
• Conditionals – if, unless, case, etc.
• Loops – while, for in, until, etc.
• break, next, retry and redo.
• defined? and ternary operators.
Collections (Arrays and Hashes) in Ruby
• What is a collection?
• Arrays and hashes.
• Constructing an array.
• Nesting arrays. Hash keys, iterators, etc.
Object Orientation: Individual Objects
• History – unstructured and structured code.
• Introduction to object oriented programming.
• classes and methods.
• Static and nonstatic.
• Instances, constructors and destructors.
• Accessing members of a class.
• Loading and using classes.
• Direct access to variables.
• Encouraging class use.
Classes and Objects
• Objects, classes and methods.
• Constructors and attributes.
• Instance and class variables.
• Class and object methods.
• Including files – load and require.
More Classes and Objects
• Public, private and protected visibility.
• Singletons and defs.
• Inheritance mixins, and super.
• Destructors and garbage collection.
• Namespaces and modules.
• What Regular Expressions Let You Do
• Ruby’s Regular Expressions
• Anchors, literals, character groups and counts.
• Matching in Ruby.
• Modifiers i, o, x and m.
• Pattern matching variables.
• Digging Deeper
• Pattern-based Substitution
• Advanced Regular Expressions
Special Variables and Pseudo-Variables
• ARGV, $0 and friends – the command line.
• Other special variables from $: through $$ to $<.
• Environment variables.
• Reserved words in Ruby.
• begin and end (and a mention of bEGIN and END).
• raise and rescue.
• throw and catch
MySQL Database Connectivity
• Using Ruby/DbI to connect to MySQL
• Database connectivity: introducing the DbI module
• Origins of DbI, the database interface module
• DbI architecture
• Overview of available DbDs (database drivers)
• Setting up and configuring DbI and DbDs
• Sending the SQL statement to the database for execution
• Displaying a single value returned from the database
• Displaying multiple rows of data returned from the database
• Handling errors
For more information please contact system administrator.