roller  Processing...
Shroff Publishers & Distributors Pvt. Ltd.
Login
 
 
|
Books Expand/Collapse
Skip Navigation Links.
.Net Platform
3D Computer Graphics
ABAP Programming
Academics
ACCA (Association of Chartered Certified Accountants)
Accounting
ActionScript
Active Server Pages (ASP)
Administration
ADO .NET
Adobe
Adobe Acrobat
Adobe Indesign
Adobe Photoshop
Aeronautical Engineering & Aircraft Maintenance
Aeronautics
Agile Testing
AIEEE
Ajax
Algebra
Algorithms
Amazon
Android
Animation
ANSI
Apache
Apple
Apple Mobile
Application Development
Application Program Interface
Application Software
Applications
Architecture
Architecture & Analysis
Arduino
Artificial Intelligence
Arts & Photography
AS/400
ASP.NET
Assembly Language Programming
Astronomy
Audio Books
Autocad
Aviation
Aviation Weather
Banking
Beginners Level
Biographies & Memoirs
Biography
Bioinformatics
Biological Terrorism
Biology
Biotechnology Engineering
Body, Mind & Spirit
Book Publishing
BPEL (Business Process Execution Language)
Brand Management
Buddhism
Business
Business & Economics
Business & Investing
Business & Money
Business Application
Business Communications
Business Governance
Business Intelligence
Business Management
Business Process
Business Skills
Business Software
Business, Management & Finance
C & C++
C Programming
C# / Visual C# .Net
C++ Programming
C/ C++/ C#
CADD
Career
Career Development
Career Guides
Catering & Hotel Management
Certification
Chartered Accountancy
Chemical Engineering
Chemistry
CIA
CICS
CIMA (Chartered Institute of Management Accountants)
CISA
Cisco / Brocade
CISSP
Civil Aviation Requirement
Civil Engineering
Civil Services Aptitude Test (CSAT)
Client/Server
Clothing
Cloud Computing
Cloud Programming
CMMI (Capability Maturity Model Integration)
Cobol
Coldfusion
COM / DCOM / COM+
Communications
Competitive Examination
Complete Study Text
Complete Text
Computer Architecture
Computer Games
Computer Graphics
Computer Programming
Computer Science
Computer Security
Computer Vision
Computers
Computers & Internet
Computers & Technology
Computing
Configuration Management Software
Consumer Behaviour
Content Management System (CMS)
Cookbooks
CPIM
CQA
Crafts & Hobbies
Criminology
Crystal Reports
CSS (Cascading Style Sheets)
Current Affairs
Customer Relationship Management (CRM)
Data
Data Analysis
Data Modeling
Data Modeling & Design
Data Science
Data Warehousing
Database Management
Database Programming
Databases
Databases & Big Data
DB2
Decorative Arts & Design
Defence
Dental
Design
Desktop Publishing (Macintosh & Windows)
DHTML
Digital Audio
Digital Media
Digital Photography
Digital Video
Distributed Computing
DIY Projects
DNS
Drafting
Dreamweaver Ultradev / Dreamweaver MX / Dreamweaver CS
Drupal
E- Commerce
E-Commerce
E-Learning
Eclipse
Economics
Education & Reference
Educational
Electrical Engineering
Electronic Project
Electronics
Electronics Engineering
ELT & Dictionary
Email
Embedded Systems
Engineering
Engineering & Transportation
English
English Language Teaching
Enterprise
Enterprise JavaBeans (EJB)
Enterprise Products and Platforms
Enterprise Service Bus (ESB)
Entrepreneurship
Environment
Environmental Studies
Ergonomic
ERP (Enterprise Resource Planning)
Exam Kit
Exam Preparation
Experiments & Projects
F#
Family & Relationships - Parenting
FAQ (Frequently Asked Questions)
Fashion Design
Fashion Technology
Fiction
Filemaker Pro
Finance
Financial Accounting
Financial Applications
Financial Management
Financial Operations
Financial Strategy
Flash
Flex
Flight
Food Recipes
Foreign Exchange
Forensics
French
Functional Programming
Game Development
Game Programming
Games & Strategy Guides
General
General Computing
Geographical Information Systems (GIS)
Geometry
Globalization
GMAT (Graduate Management Admission Test)
GNU
Google
Google Android
Graph Theory
Graphics
Graphics Design
Graphics Programming
GRE (Graduate Record Examination)
Green Computing
Hacking
Hardware
Hardware & DIY
Haskell
Health
Health & Fitness - Healing
Health IT
Health, Mind & Body
Hedge Funds
Hibernate
History
Hive
Hobbies
Home Improvement & Design
Hospitality
Hospitality Management
Hotel Management
HRD
HTML
HTML5
Human Resource Management
Human Resource Management Systems (HRMS)
IBM
IBM Mainframe
IBM Technical Resources
IBM WebSphere
IIT-JEE
Image Processing
IMAP (Internet Message Access Protocol)
Industrial Design
Industrial Engineering
Information Management
Information Management Software
Information Security
Information Technology
Information Theory
Infrastructure Solutions
Innovation Management
Inspirational
Insurance
Integration Software
Interactive Text
Interior Design
International Business
International Developemnt
International Trade
Internet
Internet & Digital Media
Internet & Web
Internet Advertising
Internet Programming
Internet Protocol
Internet Security
Introducing to Computers
Inventions
Investments
iOS Programming
iPad
iPhone
iPod
Islamic Finance
IT Management
ITIL
Jakarta Commons
Jakarta Struts
Java
Java 2 Enterprise Edition (J2EE)
Java Certification
Java Programming
Java Server Programming
JavaScript
JavaServer Faces (JSF)
JavaServer Pages (JSP)
JBoss
JDBC
Jini
Joomla!
Journalism
jQuery
Laboratory
labour
LAN (Local Area Network)
Language
Law
LDAP
Leadership
Learning Disability
Linux
Liquor
Literature
Logistics
Lotus Notes & Domino
Mac
Mac OS
Machine Learning
Macintosh
Main Exams
Management
Management Information System (MIS)
Marine
Marine Engineering
Marketing
Marketing Management
Mathematical & Statistical Software
Mathematics
Matlab
Maya
MCSA / MCSE / MCSD
Mechanical Engineering
Media
Medical
Microcontrollers
Microfinance
Microservices
Microsoft
Microsoft .Net Framework
Microsoft Access
Microsoft Certification
Microsoft Development
Microsoft Dynamics
Microsoft Excel
Microsoft Frontpage
Microsoft Office
Microsoft PowerPoint
Microsoft Programming
Microsoft Project
Microsoft Sharepoint
Microsoft Silverlight
Microsoft SQL Server
Microsoft Visual Basic
Microsoft Windows
Microsoft Word
Missing Manual
Mobile Computing
Mobile Development
Mobile Device
Mobile Enterprise
Mobile Programming
Mobile Security
Moodle
Motivational
Mulitmedia Development
Multimedia
Multithreaded
Murach
Musical Instruments
MySQL
Negotiating
Network
Network Administration
Networking
Networking & Cloud Computing
New Age
Non Fiction
NTSE
Nursing
Object Technology
Object-Oriented Programming
Office Application
Online Marketing
OOP
Open Source
OpenGL Programming
Operating Systems
Operation Management
Operations Management
Oracle
Organization Development
Organizational Behavior
Organizational Management
Patent and Trademarks
Patterns
PC Hardware
PeopleSoft
Performance
Perl
Personal Computers
Personal Growth
Pharmacology
Philosophy
Photography
PHP
Physics
PMI-ACP Exam
PMP
Pocket Notes
Political Science
Politics & Government
Postfix
Practice & Revision Kit
Presentation Software
Product Design
Professionals
Programming
Programming & Software Development
Programming Languages
Programming Tools
Project Book
Project Management
PSAT/NMSQT
Psychology
Python
Quality
Quality Management
Quick Test Professional (QTP)
Rails
Raspberry Pi
RDF
Real Estate/Home Buying Guides
Recipes
Reference
Relationship Marketing
Religion & Spirituality
Research Methods in Management
Revision Cards
RFID (Radio Frequency Identification)
Risk Management
Risk Management & Insurance
Robotics
Rockets
RPG (Report Program Generator)
RSS (Rich Site Summary)
Ruby
Sales and Distribution
Sales Management
Samba
SAP
SAP At Special Price
SAS
SAT (Scholastic Aptitude Test)
Science
Science & Math
Sciences, Technology & Medicine
Search Engine Marketing
Search Engine Optimization (SEO)
Security
Self-Help
Sendmail
SharePoint
Skills
SOA: Service-Oriented Architecture
SOAP
Social Aspects
Social Media
Social Networking
Social Sciences
Social Web
Software
Software Architecture
Software Design
Software Development
Software Documentation
Software Engineering
Software Project
Software Testing
Solaris
Special Discounts
Special Price
Spiritual
Sports
Spreadsheet
Spring
SQL
Statistics
Statistics Programming
Stock Market
Strategic Management
Structural Analysis & Design
Study Aids
Study Guide
Success
Supply Chain Management
Sybase
System Administration
System Programming
Systems Analysis & Design
TCP/IP
Tech Culture
Technical Writing
Technology
Technology & Engineering
Telecommunications
Telephony
Test Preparation
Text Processing
Textbooks
Time Management
Tivoli
TOEFL (Test of English as a Foreign Language)
Tomcat
Trade Business
Transportation
Travel and Tourism Management
UML (Unified Modeling Language)
Unix
Unix Programming
Unix System Administration
Unix Text Editing
Unix Utilities
Usability
Used Books
User Experience
User Interface Design
UX (User experience)
Valuation
VBA
VBScript
View Engine
Virtualization
Virtualization and Cloud
Visual Basic
Visual Basic .Net / VB .NET
Visual Basic Certification
Visual Basic Programming
Visual C++
Visual Studio .Net
Vmware
Vocational
VoIP
VPN (Virtual Private Networks)
WAP
Wearables
Web
Web Analytics
Web Application
Web Application Framework
Web Applications Testing
Web Authoring
Web Design
Web Development
Web Development & Design
Web Graphics & Video
Web Marketing
Web Programming
Web Publishing
Web Security
Web Server
Web Services
WebLogic
Website Optimization
WebSphere
Windows
Windows 2000
Windows 7
Windows 8
Windows 95
Windows Administration
Windows Applications
Windows Forms
Windows NT
Windows NT Administration
Windows Programming
Windows Server
Windows Server 2003
Windows Vista
Windows XP
Wireless
WordPress
Workplace Culture
World Wide Web
X Windows
XHTML
XML (Extensible Markup Language)
XSL
XSLT
Yoga
Titles By Year Expand/Collapse
Product Details
Head First Ruby
Head First Ruby
A learner's companion to Ruby
By Jay McGavren
|
ISBN: 9789352132539
Paperback
Pages: 572
Shroff/O'Reilly (2015)
Arrival Date: December 23, 2015
List Price: Rs 950.00
Net Price: Rs 720.00    You save 24.24%
Usually shipped in 1-2 days

Add to cart    Add to wishlist
Description Table of Contents
What will you learn from this book?

What’s all the buzz about this Ruby language? Is it right for you? Well, ask yourself: are you tired of all those extra declarations, keywords, and compilation steps in your other language? Do you want to be a more productive programmer? Then you’ll love Ruby. With this unique hands-on learning experience, you’ll discover how Ruby takes care of all the details for you, so you can simply have fun and get more done with less code.

Why does this book look so different?

Based on the latest research in cognitive science and learning theory, Head First Ruby uses a visually rich format to engage your mind, rather than a text-heavy approach that puts you to sleep. Why waste your time struggling with new concepts? This multi-sensory learning experience is designed for the way your brain really works.

About the Author

Jay McGavren

Jay McGavren was doing automation for a hotel services company when a colleague introduced him to Programming Perl (a.k.a. the Camel Book). It made him an instant Perl convert, as he liked actually writing code instead of waiting for a 10-person development team to configure a build system. It also gave him the crazy idea to write a technical book someday.

In 2007, with Perl sputtering, Jay was looking for a new interpreted language. With its strong object-orientation, excellent library support, and incredible flexibility, Ruby immediately won him over. He's since used Ruby for two game libraries, a generative art project, in support of a Java development job, and as a Ruby on Railsfreelancer. He's been using Rails in the online developer education space since 2011.
Chapter 1. More with Less: Code the Way You Want
The Ruby philosophy
Get Ruby
Use Ruby
Use Ruby—interactively
Your first Ruby expressions
Math operations and comparisons
Strings
Variables
Everything is an object!
Calling a method on an object
Let’s build a game
Input, storage, and output
Running scripts
Comments
“puts” and “print”
Method arguments
“gets”
Parentheses are optional on method calls
String interpolation
What’s in that string?
Inspecting objects with the “inspect” and “p” methods
Escape sequences in strings
Calling “chomp” on the string object
What methods are available on an object?
Generating a random number
Converting to strings
Ruby makes working with strings easy
Converting strings to numbers
Conditionals
The opposite of “if” is “unless”
Loops
Let’s try running our game!
Your Ruby Toolbox
Up Next...

Chapter 2. Methods and Classes: Getting Organized
Defining methods
Calling methods you’ve defined
Method names
Parameters
Optional parameters
Return values
Returning from a method early
Some messy methods
Too many arguments
Too many “if” statements
Designing a class
What’s the difference between a class and an object?
Your first class
Creating new instances (objects)
Breaking up our giant methods into classes
Creating instances of our new animal classes
Updating our class diagram with instance methods
Our objects don’t “know” their names or ages!
Too many arguments (again)
Local variables live until the method ends
Instance variables live as long as the instance does
Encapsulation
Attribute accessor methods
Using accessor methods
Attribute writers and readers
Attribute writers and readers in action
Ensuring data is valid with accessors
Errors—the “emergency stop” button
Using “raise” in our attribute writer methods
Our complete Dog class
Your Ruby Toolbox
Up Next...

Chapter 3. Inheritance: Relying on Your Parents
Copy, paste... Such a waste...
Mike’s code for the virtual test-drive classes
Inheritance to the rescue!
Defining a superclass (requires nothing special)
Defining a subclass (is really easy)
Adding methods to subclasses
Subclasses keep inherited methods alongside new ones
Instance variables belong to the object, not the class!
Overriding methods
Bringing our animal classes up to date with inheritance
Designing the animal class hierarchy
Code for the Animal class and its subclasses
Overriding a method in the Animal subclasses
We need to get at the overridden method!
The “super” keyword
A super-powered subclass
Difficulties displaying Dogs
The Object class
Why everything inherits from the Object class
Overriding the inherited method
Your Ruby Toolbox
Up Next...

Chapter 4. Initializing Instances: Off to a Great Start
Payroll at Chargemore
An Employee class
Creating new Employee instances
A division problem
Division with Ruby’s Fixnum class
Division with Ruby’s Float class
Fixing the salary rounding error in Employee
Formatting numbers for printing
Format sequences
Format sequence types
Format sequence width
Format sequence width with floating-point numbers
Using “format” to fix our pay stubs
When we forget to set an object’s attributes...
“nil” stands for nothing
“/” is a method
The “initialize” method
Employee safety with “initialize”
Arguments to “initialize”
Using optional parameters with “initialize”
“initialize” does an end-run around our validation
“initialize” and validation
Call other methods on the same instance with “self”
When “self” is optional
Implementing hourly employees through inheritance
Restoring “initialize” methods
Inheritance and “initialize”
“super” and “initialize”
Same class, same attribute values
An inefficient factory method
Class methods
Our complete source code
Your Ruby Toolbox
Up Next...

Chapter 5. Arrays and Blocks: Better Than Loops
Arrays
Accessing arrays
Arrays are objects, too!
Looping over the items in an array
The repeating loop
Eliminating repetition...the WRONG way...
Chunks of code?
Blocks
Defining a method that takes blocks
Your first block
Flow of control between a method and block
Calling the same method with different blocks
Calling a block multiple times
Block parameters
Using the “yield” keyword
Block formats
The “each” method
The “each” method, step-by-step
DRYing up our code with “each” and blocks
Blocks and variable scope
Using “each” with the “refund” method
Using “each” with our last method
Our complete invoicing methods
We’ve gotten rid of the repetitive loop code!
Utilities and appliances, blocks and methods
Your Ruby Toolbox
Up Next...

Chapter 6. Block Return Values: How Should I Handle This?
A big collection of words to search through
Opening the file
Safely closing the file
Safely closing the file, with a block
Don’t forget about variable scope!
Finding array elements we want, with a block
The verbose way to find array elements, using “each”
Introducing a faster method...
Blocks have a return value
How the method uses a block return value
Putting it all together
A closer look at the block return values
Eliminating elements we don’t want, with a block
The return values for “reject”
Breaking a string into an array of words
Finding the index of an array element
Making one array that’s based on another, the hard way
Making one array based on another, using “map”
Some additional logic in the “map” block body
The finished product
Your Ruby Toolbox
Up Next...

Chapter 7. Hashes: Labeling Data
Counting votes
An array of arrays...is not ideal
Hashes
Hashes are objects
Hashes return “nil” by default
nil (and only nil) is “falsy”
Returning something other than “nil” by default
Normalizing hash keys
Hashes and “each”
A mess of method arguments
Using hashes as method parameters
Hash parameters in our Candidate class
Leave off the braces!
Leave out the arrows!
Making the entire hash optional
Typos in hash arguments are dangerous
Keyword arguments
Using keyword arguments with our Candidate class
Required keyword arguments
Your Ruby Toolbox
Up Next...

Chapter 8. References: Crossed Signals
Some confusing bugs
The heap
References
When references go wrong
Aliasing
Fixing the astronomer’s program
Quickly identifying objects with “inspect”
Problems with a hash default object
We’re actually modifying the hash default object!
A more detailed look at hash default objects
Back to the hash of planets and moons
Our wish list for hash defaults
Hash default blocks
Hash default blocks: Assigning to the hash
Hash default blocks: Block return value
Hash default blocks: A shortcut
The astronomer’s hash: Our final code
Using hash default objects safely
Hash default object rule #1: Don’t modify the default object
Hash default object rule #2: Assign values to the hash
The rule of thumb for hash defaults
Your Ruby Toolbox
Up Next...

Chapter 9. Mixins: Mix It Up
The media-sharing app
The media-sharing app...using inheritance
One of these classes is not (quite) like the others
Option one: Make Photo a subclass of Clip
Option two: Copy the methods you want into the Photo class
Not an option: Multiple inheritance
Using modules as mixins
Mixins, behind the scenes
Creating a mixin for comments
Using our comments mixin
A closer look at the revised “comments” method
Why you shouldn’t add “initialize” to a mixin
Mixins and method overriding
Avoid using “initialize” methods in modules
Using the Boolean “or” operator for assignment
The conditional assignment operator
Our complete code
Your Ruby Toolbox
Up Next...

Chapter 10. Comparable and Enumerable: Ready-Made Mixes
Mixins built into Ruby
A preview of the Comparable mixin
Choice (of) beef
Implementing a greater-than method on the Steak class
Constants
We have a lot more methods to define...
The Comparable mixin
The spaceship operator
Implementing the spaceship operator on Steak
Mixing Comparable into Steak
How the Comparable methods work
Our next mixin
The Enumerable module
A class to mix Enumerable into
Mixing Enumerable into our class
Inside the Enumerable module
Your Ruby Toolbox
Up Next...

Chapter 11. Documentation: Read the Manual
Learning how to learn more
Ruby’s core classes and modules
Documentation
HTML documentation
Listing available classes and modules
Looking up instance methods
Instance methods denoted with # in the docs
Instance method documentation
Arguments in call signatures
Blocks in call signatures
Read the docs for the superclass and mixins, too!
Read the docs for the superclass and mixins, too! (continued)
Pool Puzzle
Pool Puzzle Solution
Looking up class methods
Class method documentation
Docs for a class that doesn’t exist?!
The Ruby standard library
Looking up classes and modules in the standard library
Where Ruby docs come from: rdoc
What rdoc can deduce about your classes
Adding your own documentation, with comments
The “initialize” instance method appears as the “new” class method
Your Ruby Toolbox
Up Next...

Chapter 12. Exceptions: Handling the Unexpected
Don’t use method return values for error messages
Using “raise” to report errors
Using “raise” by itself creates new problems
Exceptions: When something’s gone wrong
Rescue clauses: A chance to fix the problem
Ruby’s search for a rescue clause
Using a rescue clause with our SmallOven class
We need a description of the problem from its source
Exception messages
Our code so far...
Different rescue logic for different exceptions
Exception classes
Specifying exception class for a rescue clause
Multiple rescue clauses in one begin/end block
Updating our oven code with custom exception classes
Trying again after an error with “retry”
Updating our oven code with “retry”
Things you want to do no matter what
The ensure clause
Ensuring the oven gets turned off
Your Ruby Toolbox
Up Next...

Chapter 13. Unit Testing: Code Quality Assurance
Automated tests find your bugs before someone else does
A program we should have had automated tests for
Types of automated tests
MiniTest: Ruby’s standard unit-testing library
Running a test
Testing a class
A closer look at the test code
Red, green, refactor
Tests for ListWithCommas
Getting the test to pass
Another bug to fix
Test failure messages
A better way to assert that two values are equal
Some other assertion methods
Removing duplicated code from your tests
The “setup” method
The “teardown” method
Updating our code to use the “setup” method
Your Ruby Toolbox
Up Next...

Chapter 14. Web Apps: Serving HTML
Writing web apps in Ruby
Our task list
Project directory structure
Browsers, requests, servers, and responses
Sinatra takes requests
Downloading and installing libraries with RubyGems
Installing the Sinatra gem
A simple Sinatra app
Your computer is talking to itself
Request type
Resource path
Sinatra routes
Multiple routes in the same Sinatra app
A route for the list of movies
Making a movie list in HTML
Accessing the HTML from Sinatra
A class to hold our movie data
Setting up a Movie object in the Sinatra app
ERB embedding tags
The ERB output embedding tag
Embedding a movie title in our HTML
Pool Puzzle
Pool Puzzle Solution
The regular embedding tag
Looping over several movie titles in our HTML
Letting users add data with HTML forms
Getting an HTML form for adding a movie
HTML tables
Cleaning up our form with an HTML table
There’s still more to do
Your Ruby Toolbox
Up Next...

Chapter 15. Saving and Loading Data: Keep It Around
Saving and retrieving form data
Our browser can GET the form...
... But it needs to POST the response
Setting the HTML form to send a POST request
Setting up a Sinatra route for a POST request
Converting objects to and from strings with YAML
Saving objects to a file with YAML::Store
Saving movies to a file with YAML::Store
A system for finding Movies in the YAML::Store
Numeric IDs for Movies
Finding the next available movie ID
A class to manage our YAML::Store
Using our MovieStore class in the Sinatra app
Testing the MovieStore
Loading all movies from the MovieStore
Loading all movies from the MovieStore (continued)
Loading all movies in the Sinatra app
Building HTML links to individual movies
Building HTML links to individual movies (continued)
Named parameters in Sinatra routes
Using a named parameter to get a movie’s ID
Defining routes in order of priority
Finding a Movie in the YAML::Store
An ERB template for an individual movie
Finishing the Sinatra route for individual movies
Let’s try it all out!
Our complete app code
Your Ruby Toolbox
Up Next...

Appendix Leftovers: The top ten topics (we didn’t cover)
#1 Other cool libraries
#2 Inline if and unless
#3 Private methods
#4 Command-line arguments
#5 Regular expressions
#6 Singleton methods
#7 Call any method, even undefined ones
#7 Call any method, even undefined ones (continued)
#8 Automating tasks with Rake
#9 Bundler
#10 Other books

Appendix This isn’t goodbye

Appendix O’reilly®: Ruby
What will you learn from this book?
What’s so special about this book?
MINI CART

Your cart is empty.
MINI WISHLIST

Your wishlist is empty.