Difference between revisions of "Ruby"
Pratham920 (Talk | contribs) (→Basic Level) |
PoojaMoolya (Talk | contribs) |
||
Line 54: | Line 54: | ||
#**Declaring and Calling a method | #**Declaring and Calling a method | ||
#*Passing arguments to a method | #*Passing arguments to a method | ||
+ | #**Explaining the arguments and syntax with example. | ||
#*Passing value to a method | #*Passing value to a method | ||
+ | #**Explaining the syntax with example. | ||
#*Returning value from a method | #*Returning value from a method | ||
+ | #**Explaining the syntax with example | ||
#Arithmetic & Relational Operators in Ruby | #Arithmetic & Relational Operators in Ruby | ||
#*Arithmetic Operators | #*Arithmetic Operators |
Revision as of 10:28, 17 December 2014
Introduction to Ruby
Ruby has been described as an absolutely pure object-oriented scripting language and a genuine attempt to combine the best of everything in the scripting world.Its creator, Yukihiro “matz” Matsumoto, blended parts of his favorite languages (Perl, Smalltalk, Eiffel, Ada, and Lisp) to form a new language that balanced functional programming with imperative programming.Ruby is written in C, and it was designed with Perl and Python capabilities in mind.
Ruby supports multiple programming paradigms including functional, object oriented, imperative and reflective. It also has a dynamic type system and automatic memory management.It's consistency and it's object model make it easy to use. The syntax is simple, clean, and readable, with an expressiveness that gives your code a natural flow.
Ruby is also a great general purpose language. It can be used to write scripts and can be also used to create full scale, standalone GUI based applications.It is also great for serving web pages, generating dynamic web page content and excels at database access tasks.
Being an interpreted language means that Ruby is portable. Once an application has been developed in Ruby it will run equally well on Ruby supported platforms such as Linux, UNIX, Windows and MacOS X.
Basic Level
- Hello Ruby
- Introduction to Ruby
- What is Ruby?
- Features
- Ruby gems
- Help on ruby
- Installation
- Installation of ruby 1.9 through Ubuntu Software Centre
- Other methods to install ruby
- Rvm (ruby version manager)
- Rbenv
- Running ruby code
- Three ways to execute ruby code
- Interactive ruby
- As a file
- From commandline
- Example :Hello World
- Three ways to execute ruby code
- Commenting in Ruby
- How to add comments
- single line comments
- multiple line or block comments
- How to add comments
- Difference between Puts and Print in ruby
- Explaining the difference by using example
- Introduction to Ruby
- Variables in Ruby
- Introduction
- Ruby and variable Dynamic typing
- Declaring a variable
- Changing variable type
- Converting the var value i.e to float,string,binary etc
- Scope of Variables
- What is variable scope
- Types of variables
- Global variable
- local variable
- class variable
- instance variable
- constant variable
- Introduction
- Ruby Methods
- What is method
- Working with methods
- Declaring and Calling a method
- Passing arguments to a method
- Explaining the arguments and syntax with example.
- Passing value to a method
- Explaining the syntax with example.
- Returning value from a method
- What is method
#**Explaining the syntax with example
- Arithmetic & Relational Operators in Ruby
- Arithmetic Operators
- Demostrating arithemtic operators like +,-,/,%,* using irb
- Operator Precedence
- Relational Operators
- Demostrating arithemtic operators like ==,!=,<,>,<= ,>= using irb
- Arithmetic Operators
- Logical & other operators
- Logical operator
- Demostrating logical operators like and (&&),or(||),not(!) using irb
- Parallel assignment
- Range operators
- Inclusive Operator(..)
- Exclusive operator (...)
- Logical operator
- Control Statements in Ruby
- What are control statements
- Syntax for
- if statement
- if..else statement
- if..elsif statement
- Examples on it
- Ternary Operator
- Syntax for case statement and example on it
- Comparison between if..elsif and case statement
Intermediate level
- Looping Statements
- Loops
- Understanding the flow of loop
- Syntax for
- while loop
- until
- unless
- Examples based on this loops
- Loops
- Looping Methods
- Syntax for
- for loop
- times method
- upto method
- downto method
- Examples based on the above methods
- Syntax for
- Creating Strings in Ruby
- What is string
- Learning to create and manipulate the strings
- Performing operation on string like
- String length
- String concatenation
- String Comparison
- String Replacement & substitution
- String conversion to
- Array
- Uppercase
- Other object type
- What is string
- Collections in Ruby
- Array
- What is an array
- Creating a new array
- Iterating the array using each loop
- Operation on array like sorting, reversing
- Hashes
- What is hash
- Difference between hash and array
- Creating and accessing the hash
- Array
Advanced level
- Ruby Object Oriented Programming
- Class
- What is Class
- What is Object
- Defining Ruby Class
- Creating Object from Class
- Variables
- Class Variable
- Instance Variable
- Methods
- Instance Methods
- Accessor Methods
- Access Control
- Explaining the access specifier
- public
- private
- protected
- Explaining the access specifier
- Class
- Class Inheritance & Duck typing
- Introduction
- What is inheritance
- Superclass & subclass
- Type of inheritance
- Single Inheritance
- Mixin in ruby
- Implementing multiple inheritance using module
- Duck typing
- What is duck typing
- Example
- Introduction
- Files in Ruby
- Creating files
- Reading and Writing files
- Opening an existing file
- Delete and rename files
- Exception Handling
- Introduction
- What is exception
- Exception class
- User Defined Exception
- Raising Exception
- Rescuing Exception
- Catch and throw
- Introduction