Programming Tutorials

ruby Tutorials

21. Using Forwardable in Ruby

By: James Edward Gray II : 2009-03-03

Description: Forwardable makes building a new class based on existing work, with a proper interface, almost trivial. We want to rely on what has come before obviously, but with delegation we can take just the methods we need and even rename them as appropriate. In many cases this is preferable to inheritance, which gives us the entire old interface, even if much of it isn't needed.


22. Traversing all files in a directory using Ruby

By: Emiley J. : 2009-03-03

Description: The Find module supports the top-down traversal of a set of file paths. For example, to total the size of all files under your home directory, ignoring anything in a "dot" directory


23. Active Record in Ruby on Rails

By: David Heinemeier Hansson : 2009-03-03

Description: Active Record connects business objects and database tables to create a persistable domain model where logic and data are presented in one wrapping. It‘s an implementation of the object-relational mapping (ORM) pattern


24. Defining tables and classes (using MySQL) in Ruby on Rails

By: David Heinemeier Hansson : 2009-03-03

Description: Data definitions are specified only in the database. Active Record queries the database for the column names (that then serves to determine which attributes are valid) on regular object instantiation through the new constructor and relies on the column names in the rows with the finders.


25. Action Pack - Ruby On rails from request to response

By: David Heinemeier Hansson : 2009-03-03

Description: Action Pack splits the response to a web request into a controller part (performing the logic) and a view part (rendering a template). This two-step approach is known as an action, which will normally create, read, update, or delete (CRUD for short) some sort of model part (often backed by a database) before choosing either to render a template or redirecting to another action.


26. Sending emails and Receiving emails using Ruby On rails

By: David Heinemeier Hansson : 2009-03-03

Description: Action Mailer is a framework for designing email-service layers. These layers are used to consolidate code for sending out forgotten passwords, welcome wishes on signup, invoices for billing, and any other use case that requires a written notification to either a person or another system.


27. unescapeElement() in Ruby

By: Jeeva : 2009-03-03

Description: Undo escaping such as that done by CGI::escapeElement()


28. Standard Library Packages in Ruby

By: Emiley J. : 2009-03-03

Description: This is a list of standard library packages in Ruby


29. Module Abbrev in Ruby

By: Emiley J. : 2009-03-03

Description: Given a set of strings, calculate the set of unambiguous abbreviations for those strings, and return a hash where the keys are all the possible abbreviations and the values are the full strings. Thus, given input of "car" and "cone", the keys pointing to "car" would be "ca" and "car", while those pointing to "cone" would be "co", "con", and "cone".


30. encoding and decoding in Ruby using Base64 Module

By: Emiley J. : 2009-03-03

Description: The Base64 module provides for the encoding (encode64) and decoding (decode64) of binary data using a Base64 representation.