Ruby Programming
Ruby Programming
SECOND
EDITION
Whats Inside
Author:
David A. Black
SUMMARY
This is a good time for Ruby! It's powerful like Java or C++, and has dynamic features that let your
code react gracefully to changes at runtime. And it's elegant, so creating applications, development
tools, and administrative scripts is easier and more straight forward. With the long-awaited Ruby
2, an active development community, and countless libraries and productivity tools, Ruby has
/dtechpress
/dreamtechpress
dreamtechpress.wordpress.com
TABLE OF CONTENTS
PART 1 RUBY FOUNDATIONS
1 Bootstrapping your Ruby literacy
1.1 Basic Ruby language literacy
1.2 Anatomy of the Ruby installation
1.3 Ruby extensions and programming
libraries
1.4 Outofthebox Ruby tools and
applications
2 Objects, methods, and local variables
2.1 Talking to objects
2.2 Crafting an object: The behavior of a
ticket
2.3 The innate behaviors of an object
2.4 A close look at method arguments
2.5 Local variables and variable
assignment
3 Organizing objects with classes
3.1 Classes and instances
3.2 Instance variables and object state
3.3 Setter methods
3.4 Attributes and the attr_* method
family
3.5 Inheritance and the Ruby class
hierarchy
3.6 Classes as objects and message
receivers
3.7 Constants up close
3.8 Nature vs. nurture in Ruby objects
4 Modules and program organization
4.1 Basics of module creation and use
4.2 Modules, classes, and method
lookup
4.3 The method_missing method
4.4 Class/module design and naming
5 The default object (self), scope, and
visibility
5.1 Understanding self, the
current/default object
5.2 Determining scope
5.3 Deploying methodaccess rules
5.4 Writing and using toplevel methods
6 Controlflow techniques
6.1 Conditional code execution
6.2 Repeating actions with loops
6.3 Iterators and code blocks
6.4 Error handling and exceptions
Published by:
DREAMTECH PRESS
19-A, Ansari Road, Daryaganj
New Delhi-110 002, INDIA
Tel: +91-11-2324 3463-73, Fax: +91-11-2324 3078
Email: [email protected]
Website: www.dreamtechpress.com
Distributed by:
Regional Offices: Bangalore: Tel: +91-80-2313 2383, Fax: +91-80-2312 4319, Email: [email protected]
Mumbai: Tel: +91-22-2788 9263, 2788 9272, Telefax: +91-22-2788 9263, Email: [email protected]
/dtechpress
/dtechpress
/dreamtechpress
dreamtechpress.wordpress.com