Ruby and Ruby On Rail
Ruby and Ruby On Rail
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.
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.
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.
Classes
For example:-
To declare and define a class named Tale, you have to write:
class Tale
end
Classes