Read without ads and support Scribd by becoming a Scribd Premium Reader.
 
 
Free study notes on RubyBySatish Talim 
 
Free Study Notes on Ruby
Free Study notes on Ruby
Copyright © 2006All rights reserved.Author:
 You may freely copy and distribute this eBook as long as you do notmodify the text or remove this copyright notice. You must not makeany charge for this eBook.Notice: These notes are to be used for reference purposes only. Theauthor will not accept any liability for any damage caused by the useof this material.Revised Edition – 8
th
Feb. 2007First Edition – June 2006Satish Talim:http://rubylearning.com/ 
1
 
Free Study Notes on Ruby
Table of Contents
Learn Ruby with me.......................................................................................................5Preamble ....................................................................................................................5Assumptions...............................................................................................................5Using this eBook........................................................................................................5What is Ruby?............................................................................................................7How Ruby can help you, in more detail ....................................................................7Downloading Ruby and an Editor..............................................................................7Ruby Programming Environment..............................................................................8Our First Ruby program.................................................................................................9Some Features of Ruby................................................................................................11Numbers in Ruby.........................................................................................................12Operators and Precedence....................................................................................13Fun with Strings...........................................................................................................15Variables and Assignment...........................................................................................16Scope............................................................................................................................18Global scope and global variables.......................................................................18Built-in global variables.......................................................................................18Local scope..........................................................................................................18Getting input................................................................................................................19Names in Ruby.............................................................................................................20More on methods.........................................................................................................22Writing Own Methods in Ruby....................................................................................23Intercepting unrecognized messages with method_missing................................25More on the String class ..............................................................................................27Listing all methods of a class or object................................................................28Comparing two strings for equality.....................................................................28Simple Constructs in Ruby..........................................................................................30Case Expressions .................................................................................................31Arrays in Ruby.............................................................................................................32Ranges..........................................................................................................................35Blocks and Procs..........................................................................................................36Random Numbers........................................................................................................39Reading from / Writing to text files.............................................................................40Traversing Directory Trees..................................................................................40Random Access....................................................................................................40Writing our own Class.................................................................................................42Literal Constructors .............................................................................................44Garbage Collection..............................................................................................44Class Methods......................................................................................................45Self - The current/default object..................................................................................46Including Other Files...................................................................................................49Open classes.................................................................................................................51Inheritance....................................................................................................................52Duck Typing................................................................................................................55Overloading Methods...................................................................................................57Overriding Methods.....................................................................................................58Symbols........................................................................................................................59Hashes..........................................................................................................................61
Satish Talim:http://rubylearning.com/ 
2
Search History:
Searching...
Result 00 of 00
00 results for result for
  • p.
  • Notes
    Load more