Author: Saim Khalid

  • Variables and Data Types

    name = “Saim” # Stringage = 25 # Integerheight = 5.9 # Floatis_student = true # Boolean puts “Name: #{name}, Age: #{age}, Height: #{height}, Student: #{is_student}”Ruby is dynamically typed → no need to mention string, int, etc. {} → used inside strings for interpolation (inserting values). Output: Name: Saim, Age: 25, Height: 5.9, Student: true

  • Hello World

    puts “Hello, World!”puts → Prints text with a new line at the end. “Hello, World!” is a string.Output: Hello, World!

  • Ruby Cheatsheet

    The Ruby Cheatsheet provides the fundamentals of Ruby programming. It helps students and developers to build the projects and prepare for the interviews. Go through the cheat sheet and learn the concepts. Thus, this improves the coding skills. 1. Basic Syntax This is the basic syntax of the Ruby programming language that displays the text using puts and print. puts “Hello, World!” print…

  • Associated Tools

    Standard Ruby Tools The standard Ruby distribution contains useful tools along with the interpreter and standard libraries − These tools help you debug and improve your Ruby programs without spending much effort. This tutorial will give you a very good start with these tools. Additional Ruby Tools There are other useful tools that don’t come…

  • Predefined Constants

    The following table lists all the Ruby’s Predefined Constants − NOTE − TRUE, FALSE, and NIL are backward-compatible. It’s preferable to use true, false, and nil. Sr.No. Constant Name & Description 1 TRUESynonym for true. 2 FALSESynonym for false. 3 NILSynonym for nil. 4 ARGFAn object providing access to virtual concatenation of files passed as command-line…

  • Predefined Variables

    Ruby’s predefined variables affect the behavior of the entire program, so their use in libraries is not recommended. The values in most predefined variables can be accessed by alternative means. Following table lists all the Ruby’s predefined variables. Sr.No. Variable Name & Description 1 $!The last exception object raised. The exception object can also be…

  • Built in Functions

    Since the Kernel module is included by Object class, its methods are available everywhere in the Ruby program. They can be called without a receiver (functional form). Therefore, they are often called functions.A complete list of Built-in Functions is given here for your reference − Functions for Numbers Here is a list of Built-in Functions related to number. They…

  • Multithreading

    Traditional programs have a single thread of execution the statements or instructions that comprise the program are executed sequentially until the program terminates. A multithreaded program has more than one thread of execution. Within each thread, statements are executed sequentially, but the threads themselves may be executed in parallel on a multicore CPU, for example. Often on…

  • LDAP Tutorial

    Ruby/LDAP is an extension library for Ruby. It provides the interface to some LDAP libraries like OpenLDAP, UMich LDAP, Netscape SDK, ActiveDirectory. The common API for application development is described in RFC1823 and is supported by Ruby/LDAP. Ruby/LDAP Installation You can download and install a complete Ruby/LDAP package from SOURCEFORGE.NET. Before installing Ruby/LDAP, make sure you…

  • Tk Guide

    Introduction The standard graphical user interface (GUI) for Ruby is Tk. Tk started out as the GUI for the Tcl scripting language developed by John Ousterhout. Tk has the unique distinction of being the only cross-platform GUI. Tk runs on Windows, Mac, and Linux and provides a native look-and-feel on each operating system. The basic…