SlideShare a Scribd company logo
1 of 8
RUBY
- A PROGRAMMER’S FUN LANGUAGE
-KHAN
Introduction:
1. An Imperative language
2. Object – oriented language
3. Can be used on all platforms
4. Programmer friendly
▶ Easy syntaxes :
Loops do not need blocks.
Pre-defined blocks for loops and conditions.
Accessing of elements is easy.
No need to specify the data types of variables.
Key words are easier to use that follow basic English language.
▶ Variables can be easily classified into various types.
▶ Single statement without any class or method can also be
executed.
▶ Many predefined methods for arithmetic operations.
▶ Ruby considers every entity in it as an object.
▶ Object creation is very easy and it can access every variable and
method in the class and also super class.
Classes in Ruby:
▶ Classes can be used in Ruby with methods and variables in it.
▶ Classes may contain Class, Global, Instance , Block variables.
▶ Object must be created to access a class created. The object of a
class or any variable can also be created.
▶ Ruby supports Single Inheritance from parent class.
Inheritance uses “<“ symbol to access super class
elements.
Variables and Methods :
▶ Ruby has five types of variables :
▶ Global : These can be accessed along all the classes and the
objects in the package or project. It is classified by “ $“
▶ Instance : These can be accessed in the class in which it is declared
. It is classified by “ @“
▶ Class variables : These can be accessed in the class in which it is
declared . It should be compulsory initialised before it is used in the
further operations .It is classified by “ @@“
▶ Block variables: These can be accessed only in the Block in which it
is declared . The scope of the variables is only within the block.
▶ Ruby Pseudo-Variables: these are constants like ‘true’ ,’ false’, ‘self’ ,
‘nil’ .
Ranges :
▶ Ruby has a special feature named Ranges.
▶ It is same as the ‘for’ loop in various programming languages .
▶ This iterates the continuous variables in the range.
▶ Example:
▶ (1..10) gives values from 1 to 10 .
▶ (‘a’..’g’) gives characters from a to g in alphabetical order.

More Related Content

What's hot

What's hot (19)

Java variable types
Java variable typesJava variable types
Java variable types
 
2- Introduction to java II
2-  Introduction to java II2-  Introduction to java II
2- Introduction to java II
 
Multiple Inheritance
Multiple InheritanceMultiple Inheritance
Multiple Inheritance
 
5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java5- Overriding and Abstraction In Java
5- Overriding and Abstraction In Java
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Delegate - KhanhLD
Delegate - KhanhLDDelegate - KhanhLD
Delegate - KhanhLD
 
Object as function argument , friend and static function by shahzad younas
Object as function argument , friend and static function by shahzad younasObject as function argument , friend and static function by shahzad younas
Object as function argument , friend and static function by shahzad younas
 
Polymorphism in Python
Polymorphism in Python Polymorphism in Python
Polymorphism in Python
 
Friend function & friend class
Friend function & friend classFriend function & friend class
Friend function & friend class
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
OOPS Characteristics
OOPS CharacteristicsOOPS Characteristics
OOPS Characteristics
 
Friend Function
Friend FunctionFriend Function
Friend Function
 
Final presentation programming
Final presentation programmingFinal presentation programming
Final presentation programming
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Ruby
RubyRuby
Ruby
 
27csharp
27csharp27csharp
27csharp
 
Python: Multiple Inheritance
Python: Multiple InheritancePython: Multiple Inheritance
Python: Multiple Inheritance
 
Oopsinphp
OopsinphpOopsinphp
Oopsinphp
 
Java interfaces
Java   interfacesJava   interfaces
Java interfaces
 

Similar to Ruby_Basic.pptx

Similar to Ruby_Basic.pptx (20)

java part 1 computer science.pptx
java part 1 computer science.pptxjava part 1 computer science.pptx
java part 1 computer science.pptx
 
Inheritance
InheritanceInheritance
Inheritance
 
Core Java Introduction | Basics
Core Java Introduction  | BasicsCore Java Introduction  | Basics
Core Java Introduction | Basics
 
Inheritance and Polymorphism
Inheritance and PolymorphismInheritance and Polymorphism
Inheritance and Polymorphism
 
Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)Class Members Access/Visibility Guide (Checklist)
Class Members Access/Visibility Guide (Checklist)
 
Lecture 8
Lecture 8Lecture 8
Lecture 8
 
Traits composition
Traits compositionTraits composition
Traits composition
 
Md03 - part3
Md03 - part3Md03 - part3
Md03 - part3
 
11 Inheritance.ppt
11 Inheritance.ppt11 Inheritance.ppt
11 Inheritance.ppt
 
PPT Lecture-1.4.pptx
PPT Lecture-1.4.pptxPPT Lecture-1.4.pptx
PPT Lecture-1.4.pptx
 
Inheritance in C++
Inheritance in C++Inheritance in C++
Inheritance in C++
 
Unit 3
Unit 3Unit 3
Unit 3
 
full defination of final opp.pptx
full defination of final opp.pptxfull defination of final opp.pptx
full defination of final opp.pptx
 
OOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdfOOP Assign No.03(AP).pdf
OOP Assign No.03(AP).pdf
 
OCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference CardOCP Java (OCPJP) 8 Exam Quick Reference Card
OCP Java (OCPJP) 8 Exam Quick Reference Card
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Java unit 7
Java unit 7Java unit 7
Java unit 7
 
Only oop
Only oopOnly oop
Only oop
 
Java/J2EE interview Qestions
Java/J2EE interview QestionsJava/J2EE interview Qestions
Java/J2EE interview Qestions
 
Java session2
Java session2Java session2
Java session2
 

More from Mohammad Junaid Khan

More from Mohammad Junaid Khan (7)

Decision trees in Machine Learning
Decision trees in Machine Learning Decision trees in Machine Learning
Decision trees in Machine Learning
 
K - Nearest neighbor ( KNN )
K - Nearest neighbor  ( KNN )K - Nearest neighbor  ( KNN )
K - Nearest neighbor ( KNN )
 
Support Vector Machines ( SVM )
Support Vector Machines ( SVM ) Support Vector Machines ( SVM )
Support Vector Machines ( SVM )
 
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
Rise of PHP and Laravel. Latest Web Frameworks built on PHP.
 
Python
PythonPython
Python
 
My SQL 1
My SQL 1My SQL 1
My SQL 1
 
Wireless transmission of power
Wireless transmission of powerWireless transmission of power
Wireless transmission of power
 

Recently uploaded

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 

Recently uploaded (20)

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 

Ruby_Basic.pptx

  • 1. RUBY - A PROGRAMMER’S FUN LANGUAGE -KHAN
  • 2. Introduction: 1. An Imperative language 2. Object – oriented language 3. Can be used on all platforms 4. Programmer friendly
  • 3. ▶ Easy syntaxes : Loops do not need blocks. Pre-defined blocks for loops and conditions. Accessing of elements is easy. No need to specify the data types of variables. Key words are easier to use that follow basic English language.
  • 4. ▶ Variables can be easily classified into various types. ▶ Single statement without any class or method can also be executed. ▶ Many predefined methods for arithmetic operations.
  • 5. ▶ Ruby considers every entity in it as an object. ▶ Object creation is very easy and it can access every variable and method in the class and also super class.
  • 6. Classes in Ruby: ▶ Classes can be used in Ruby with methods and variables in it. ▶ Classes may contain Class, Global, Instance , Block variables. ▶ Object must be created to access a class created. The object of a class or any variable can also be created. ▶ Ruby supports Single Inheritance from parent class. Inheritance uses “<“ symbol to access super class elements.
  • 7. Variables and Methods : ▶ Ruby has five types of variables : ▶ Global : These can be accessed along all the classes and the objects in the package or project. It is classified by “ $“ ▶ Instance : These can be accessed in the class in which it is declared . It is classified by “ @“ ▶ Class variables : These can be accessed in the class in which it is declared . It should be compulsory initialised before it is used in the further operations .It is classified by “ @@“ ▶ Block variables: These can be accessed only in the Block in which it is declared . The scope of the variables is only within the block. ▶ Ruby Pseudo-Variables: these are constants like ‘true’ ,’ false’, ‘self’ , ‘nil’ .
  • 8. Ranges : ▶ Ruby has a special feature named Ranges. ▶ It is same as the ‘for’ loop in various programming languages . ▶ This iterates the continuous variables in the range. ▶ Example: ▶ (1..10) gives values from 1 to 10 . ▶ (‘a’..’g’) gives characters from a to g in alphabetical order.