0% found this document useful (0 votes)
11 views8 pages

Ruby and Ruby On Rail

The document discusses key concepts in Ruby including classes, inheritance, modules, data types, blocks and iterators, exception handling, and data structures. It focuses on explaining classes, attributes, methods, and objects which are the core of object-oriented programming. Classes in Ruby are open-ended, meaning new functionality can be added to a class without inheriting from it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views8 pages

Ruby and Ruby On Rail

The document discusses key concepts in Ruby including classes, inheritance, modules, data types, blocks and iterators, exception handling, and data structures. It focuses on explaining classes, attributes, methods, and objects which are the core of object-oriented programming. Classes in Ruby are open-ended, meaning new functionality can be added to a class without inheriting from it.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Ruby

Getting to
&

Know
Ruby on Rail
*Ruby
The Basics
To understand Ruby, you will have to
understand the concepts that are
fundamental to Ruby. These concepts are:

• Classes
• Inheritance
• Module
• Data Types
• Blocks and Iterators
• Exception Handling
• Data Structures
Classes, attributes, methods, and objects
are the core of any Object-Oriented
language. How they are implemented and
how they can be used, differs from
language to language. How they are
implemented in Ruby?—that's what I am
going to discuss now.
Classes, Attributes, Methods,
and Objects
*A class is an abstract
representation of a real world
object, including its characteristics
and functionalities.

*Hence, it doesn't occupy space in


memory during the execution of the
program that contains the class.

Classes
*There are two types of classes
1) close-ended
2) open-ended.
If a class is close-ended, then new functionalities cannot be
added to it without inheriting the class.

A C++ or a Java class is close-ended because you cannot


add a new functionality to it without inheriting or
subclassing it.

Classes
*if a class is open-ended, then new functionalities can
be added to it without inheriting it.
One of the important aspects of the Ruby class is that
it is open-ended.

It means you can add new functionalities at any point


of time.

Classes
For example:-
To declare and define a class named Tale, you have to write:

class Tale

end

The class declared and defined just now is an empty class as it


doesn't contain any attributes or methods.

Classes

You might also like