Category: 1. Ruby Basic
-
Ruby Data types
Data types represents a type of data such as text, string, numbers, etc. There are different data types in Ruby: Numbers Integers and floating point numbers come in the category of numbers. Integers are held internally in binary form. Integer numbers are numbers without a fraction. According to their size, there are two types of…
-
Ruby Variables
Ruby variables are locations which hold data to be used in the programs. Each variable has a different name. These variable names are based on some naming conventions. Unlike other programming languages, there is no need to declare a variable in Ruby. A prefix is needed to indicate it. There are four types of variables…
-
Ruby Operators
Ruby has a built-in modern set of operators. Operators are a symbol which is used to perform different operations. For example, +, -, /, *, etc. Types of operators: Unary Operator Unary operators expect a single operand to run on. Operator Description ! Boolean NOT ~ Bitwise complement + Unary plus Example In file hello.rb,…
-
Hello Ruby Program
Now we will write a simple program of Ruby. Before writing Hello World program, we are assuming that you have successfully installed Ruby in your system. Requirement for Hello Ruby Program Creating Hello Ruby Program 1) Use any text editor and create a hello.rb file. Write the following code, 2) Connect Ruby path to the…
-
Ruby vs Python
Similarities Differences Terms Ruby Python Definition Ruby is an open source web application programming language. Python is a high level programming language. Object Oriented Fully object oriented programming language. Not fully object oriented programming language. Developer Yukihiro Matsumoto in 1990s. Guido Van Rossum in 1980s. Developing Environment EclipseIDE is supported. multiple IDEs are supported. Libraries…
-
What is Ruby
Ruby is a dynamic, open source, object oriented and reflective programming language. Ruby is considered similar to Perl and Smalltalk programming languages. It runs on all types of platforms like Windows, Mac OS and all versions of UNIX. It is fully object oriented programming language. Everything is an object in Ruby. Each and every code…