Learning RUBY: features of Ruby

Source: Internet
Author: User
Tags at sign

Ruby is an open-source and is freely available on the web, but it is subject to a license .. (Open Source protocol ...)

Ruby is a general-purpose, interpreted programming language. (multi-purpose, interpreted)

Ruby is a true object-oriented programming language. (Object-Oriented)

Ruby is a server-side scripting language similar to Python and Perl. (server-side script)

Ruby can be used to write Common Gateway Interface (CGI) scripts.

Ruby can be embeded into hypertext markup language (HTML ).

Ruby has a clean and easy syntax that allows a new developer to learn RUBY very quickly and easily.

Ruby has similar syntax to that of your programming versions such as C ++ and Perl.

Ruby is very much scalable and big programs written in ruby are easily maintainable.

Ruby can be used for developing Internet and Intranet applications.

Ruby can be installed in windows and POSIX environments.

Ruby support using GUI tools such as Tcl/TK, GTK, and OpenGL.

Ruby can easily be connected to DB2, MySQL, Oracle, and Sybase.

Ruby has a rich set of built-in functions which can be used directly into Ruby scripts.



Ruby is a perfect object oriented programming language. The features of the object-oriented programming language include: Object-oriented

Data encapsulation: Encapsulation

Data processing action: Abstract

Polymorphism: Polymorphism

Inheritance: Inheritance

Defining a class in Ruby:
To implement object-oriented programming by using Ruby, you need to first learn how to create objects and classes in ruby.

A class in Ruby always starts with the keyword class followed by the name of the class. The name shoshould always be in initial capitals. The class customer can be displayed:

Variables in a ruby class :( Ruby variable)
Ruby provides four types of variables:

Local variables: local variables are the variables that are defined in a method. local variables are not available outside the method. you will see more detail about method in subsequent chapter. local variables begin with a lowercase letter or _.

Instance variables: instance variables are available internal SS methods for any participant instance or object. that means that instance variables change from object to object. instance variables are preceded by the at sign (@) followed by the variable name.

Class variables: class variables are available except SS different objects. A class variable belongs to the class and is a characteristic of a class. they are preceded by the sign and are followed by the variable name.

Global variables: class variables are not available classes SS classes. if you want to have a single variable, which is available using SS classes, you need to define a global variable. the global variables are always preceded by the dollar sign ($ ).


From: http://www.tutorialspoint.com/ruby/ruby_overview.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.