SlideShare une entreprise Scribd logo
1  sur  12
   Alaa Afifi kamal
   Faculty of computers and information cairo
    university
   Vice head to social at fci student union
   Participant at NYU Abu Dhabi Hackathon
   Intern at imagine cup university (microsoft)
   Social media member st scci
   FR member at Fekra
   alaa.kamal67@yahoo.com
Introduction to Ruby
Ruby
   Ruby is a powerful, flexible programming language you can use in web/Internet development, to
    process text, to create games, and as part of the popular Ruby on Rails web framework. Ruby is:
   High-level, meaning reading and writing Ruby is really easy—it looks a lot like regular English!
   Interpreted, meaning you don't need a compiler to write and run Ruby. You can write it here at
    Codecademy or even on your own computer (many are shipped with the Ruby interpreter built
    in—we'll get to the interpreter later in this lesson).
   Object-oriented, meaning it allows users to manipulate data structures called objects in order
    to build and execute programs. We'll learn more about objects later, but for now, all you need to
    know is everything in Ruby is an object.
   Easy to use. Ruby was designed by Yukihiro Matsumoto (often just called "Matz") in 1995. Matz
    set out to design a language that emphasized human needs over those of the computer, which is
    why Ruby is so easy to pick up.
Ruby
Outline :
   Data taypes(numbers,Booleans and string)
   Operators
   (Puts,print)
   Strings
   Single _line comments
   Multi_line comments
Data types

Numbers is a data tybe at Ruby to define numbers just
My _num=25


Booleans is a data tybe at Ruby to define Booleans just
My_bool=true or false just


string is a data tybe at Ruby to define strings just
My_string=“Ruby”
operators

   Addition(+) ,subtraction(-),multiplication(*),Division(/),Exponentiation(**) and
module(%)
Exponentiation(**) is used to get the power of the number
Ex: 2 x 2 x 2 =2**3=8 .
module(%) is used to get the remainder of division
Ex: 20%3= 2
How to write it as a code?
My_num=4+4
Output= 8
(Puts,print)

   The print command just takes whatever you give it and prints it in the
    screen.


   Puts it adds a new (blank) line after the things you want it to print
    Ex: puts”Hello”
        print”Ruby”
strings
Length:
if you want to get the legth of string do that
   Ex: “Ruby”.length
   output= 4
 reverse:
 this method help us to sort a list of values
  Ex: “Ruby”.reverse
  output= ybuR
   Downcase and upcase methods convert a string ALL UPPER CASE
    or lower case
    to use upcase or downcase
    EX: puts”ruby”.upcase
      the output: RUBY
    Ex: puts”RUBY”.downcase
     the output: ruby
Single _line comments

    A comment is a bit of text that Ruby won't try to run as code: it's just for
    humans to read. Writing good comments not only clarifies your code for other
    people who may read it, but helps remind you of what you were doing when
    you wrote the code days, months, or even years earlier.


we use # to write a comment
Ex: “ I love Ruby”.length # this line return the length
Multi_line comments
    You can write a comment that spans multiple lines by starting
     each line with a # , but there's an easier way.
     if you start with =begin and end with =end ,
everything between those two expressions will be a comment.
Ex:
=begin
I love ruby
    it’s nice
=end
Thank you




Copyrights to:Alaa Afifi

Contenu connexe

Similaire à Ruby

Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorialknoppix
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Mark Menard
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overviewThomas Asikis
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Muhammad Haseeb Shahid
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_pythontutorialsruby
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short versionAntonelo Schoepf
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby BasicsSHC
 
Ruby for .NET developers
Ruby for .NET developersRuby for .NET developers
Ruby for .NET developersMax Titov
 
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07Muhammad Sunny ✈
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Rormyuser
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Chris Houng
 

Similaire à Ruby (20)

ACM Init() lesson 1
ACM Init() lesson 1ACM Init() lesson 1
ACM Init() lesson 1
 
Ruby
RubyRuby
Ruby
 
Ruby tutorial
Ruby tutorialRuby tutorial
Ruby tutorial
 
Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1Ruby on Rails Training - Module 1
Ruby on Rails Training - Module 1
 
Ruby on Rails - An overview
Ruby on Rails -  An overviewRuby on Rails -  An overview
Ruby on Rails - An overview
 
Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)Page List & Sample Material (Repaired)
Page List & Sample Material (Repaired)
 
Ruby
RubyRuby
Ruby
 
Ruby Hell Yeah
Ruby Hell YeahRuby Hell Yeah
Ruby Hell Yeah
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
ruby_vs_perl_and_python
ruby_vs_perl_and_pythonruby_vs_perl_and_python
ruby_vs_perl_and_python
 
Rubykin
Rubykin Rubykin
Rubykin
 
On the path to become a jr. developer short version
On the path to become a jr. developer short versionOn the path to become a jr. developer short version
On the path to become a jr. developer short version
 
Ruby
RubyRuby
Ruby
 
Ruby
RubyRuby
Ruby
 
Ruby Basics
Ruby BasicsRuby Basics
Ruby Basics
 
FGCU Camp Talk
FGCU Camp TalkFGCU Camp Talk
FGCU Camp Talk
 
Ruby for .NET developers
Ruby for .NET developersRuby for .NET developers
Ruby for .NET developers
 
Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07Ruby on Rails Introduction M&P - IT Skill Development Program 07
Ruby on Rails Introduction M&P - IT Skill Development Program 07
 
Intro To Ror
Intro To RorIntro To Ror
Intro To Ror
 
Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來Vim 讓你寫 Ruby 的速度飛起來
Vim 讓你寫 Ruby 的速度飛起來
 

Dernier

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Dernier (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Ruby

  • 1. Alaa Afifi kamal  Faculty of computers and information cairo university  Vice head to social at fci student union  Participant at NYU Abu Dhabi Hackathon  Intern at imagine cup university (microsoft)  Social media member st scci  FR member at Fekra  alaa.kamal67@yahoo.com
  • 3. Ruby  Ruby is a powerful, flexible programming language you can use in web/Internet development, to process text, to create games, and as part of the popular Ruby on Rails web framework. Ruby is:  High-level, meaning reading and writing Ruby is really easy—it looks a lot like regular English!  Interpreted, meaning you don't need a compiler to write and run Ruby. You can write it here at Codecademy or even on your own computer (many are shipped with the Ruby interpreter built in—we'll get to the interpreter later in this lesson).  Object-oriented, meaning it allows users to manipulate data structures called objects in order to build and execute programs. We'll learn more about objects later, but for now, all you need to know is everything in Ruby is an object.  Easy to use. Ruby was designed by Yukihiro Matsumoto (often just called "Matz") in 1995. Matz set out to design a language that emphasized human needs over those of the computer, which is why Ruby is so easy to pick up.
  • 4. Ruby Outline :  Data taypes(numbers,Booleans and string)  Operators  (Puts,print)  Strings  Single _line comments  Multi_line comments
  • 5. Data types Numbers is a data tybe at Ruby to define numbers just My _num=25 Booleans is a data tybe at Ruby to define Booleans just My_bool=true or false just string is a data tybe at Ruby to define strings just My_string=“Ruby”
  • 6. operators  Addition(+) ,subtraction(-),multiplication(*),Division(/),Exponentiation(**) and module(%) Exponentiation(**) is used to get the power of the number Ex: 2 x 2 x 2 =2**3=8 . module(%) is used to get the remainder of division Ex: 20%3= 2 How to write it as a code? My_num=4+4 Output= 8
  • 7. (Puts,print)  The print command just takes whatever you give it and prints it in the screen.  Puts it adds a new (blank) line after the things you want it to print Ex: puts”Hello” print”Ruby”
  • 8. strings Length: if you want to get the legth of string do that Ex: “Ruby”.length output= 4 reverse: this method help us to sort a list of values Ex: “Ruby”.reverse output= ybuR
  • 9. Downcase and upcase methods convert a string ALL UPPER CASE or lower case to use upcase or downcase EX: puts”ruby”.upcase the output: RUBY Ex: puts”RUBY”.downcase the output: ruby
  • 10. Single _line comments  A comment is a bit of text that Ruby won't try to run as code: it's just for humans to read. Writing good comments not only clarifies your code for other people who may read it, but helps remind you of what you were doing when you wrote the code days, months, or even years earlier. we use # to write a comment Ex: “ I love Ruby”.length # this line return the length
  • 11. Multi_line comments  You can write a comment that spans multiple lines by starting each line with a # , but there's an easier way. if you start with =begin and end with =end , everything between those two expressions will be a comment. Ex: =begin I love ruby it’s nice =end