You can find the name Yukihiro Matsumoto on the Ruby mailing list at www.ruby-lang.org. Matsumoto is also known as Matz in the Ruby community.
পৃষ্ঠাসমূহ
Labels
Search Your Article
CS
Welcome to GoogleDG – your one-stop destination for free learning resources, guides, and digital tools.
At GoogleDG, we believe that knowledge should be accessible to everyone. Our mission is to provide readers with valuable ebooks, tutorials, and tech-related content that makes learning easier, faster, and more enjoyable.
What We Offer:
-
📘 Free & Helpful Ebooks – covering education, technology, self-development, and more.
-
💻 Step-by-Step Tutorials – practical guides on digital tools, apps, and software.
-
🌐 Tech Updates & Tips – simplified information to keep you informed in the fast-changing digital world.
-
🎯 Learning Support – resources designed to support students, professionals, and lifelong learners.
✔ Latest world News
Our Vision
To create a digital knowledge hub where anyone, from beginners to advanced learners, can find trustworthy resources and grow their skills.
Why Choose Us?
✔ Simple explanations of complex topics
✔ 100% free access to resources
✔ Regularly updated content
✔ A community that values knowledge sharing
We are continuously working to expand our content library and provide readers with the most useful and relevant digital learning materials.
📩 If you’d like to connect, share feedback, or suggest topics, feel free to reach us through the Contact page.
Pageviews
Monday, April 3, 2017
Ruby - Overview
You can find the name Yukihiro Matsumoto on the Ruby mailing list at www.ruby-lang.org. Matsumoto is also known as Matz in the Ruby community.
Ruby - Environment Setup
Try it Option Online
You really do not need to set up your own environment to start learning Ruby programming language. Reason is very simple, we already have set up Ruby Programming environment online, so that you can execute almost all the tutorial examples online at the same time when you are doing your theory work.
Ruby - Syntax
#!/usr/bin/ruby -w puts "Hello, Ruby!";Here, I assumed that you have Ruby interpreter available in /usr/bin directory. Now, try to run this program as follows:
Ruby - Classes and Objects
- Data Encapsulation:
- Data Abstraction:
- Polymorphism:
- Inheritance:
Ruby Variables, Constants and Literals
There are five types of variables supported by Ruby. You already have gone through a small description of these variables in previous chapter as well. These five types of variables are explained in this chapter.
Ruby Operators
For each operator (+ - * / % ** & | ^ << >> && ||), there is a corresponding form of abbreviated assignment operator (+= -= etc.)
Ruby Comments
#!/usr/bin/ruby -w # This is a single line comment.
Ruby if...else, case, unless
Ruby if...else Statement:
Syntax:
if conditional [then] code... [elsif conditional [then] code...]... [else code...]
Ruby Loops - while, for, until, break, redo and retry
Ruby Methods
Method names should begin with a lowercase letter. If you begin a method name with an uppercase letter, Ruby might think that it is a constant and hence can parse the call incorrectly.
Ruby Blocks
- A block consists of chunks of code.
- You assign a name to a block.
- The code in the block is always enclosed within braces ({}).
Ruby Modules and Mixins
- Modules provide a namespace and prevent name clashes.
- Modules implement the mixin facility.
Ruby Strings
The simplest string literals are enclosed in single quotes (the apostrophe character). The text within the quote marks is the value of the string:
Ruby Arrays
Array indexing starts at 0, as in C or Java. A negative index is assumed relative to the end of the array --- that is, an index of -1 indicates the last element of the array, -2 is the next to last element in the array, and so on.
Ruby Hashes
The order in which you traverse a hash by either key or value may seem arbitrary and will generally not be in the insertion order. If you attempt to access a hash with a key that does not exist, the method will return nil.
Date & Time in Ruby
This tutorial will make you familiar with all the most wanted concepts of date and time.
Ruby Ranges
- Ranges as Sequences
- Ranges as Conditions
- Ranges as Intervals
Ruby Iterators - each and collect
Iterators return all the elements of a collection, one after the other. We will be discussing two iterators here, each and collect. Let's look at these in detail.
Ruby File I/O, Directories
The class IO provides all the basic methods, such as read, write, gets, puts, readline, getc, and printf.
This chapter will cover all the basic I/O functions available in Ruby. For more functions, please refer to Ruby Class IO.
Ruby Exceptions
The program stops if an exception occurs. So exceptions are used to handle various type of errors, which may occur during a program execution and take appropriate action instead of halting program completely.