IntroductionConventions Used in This BookUsing Code ExamplesSafari® Books OnlineHow to Contact UsAcknowledgmentsRunning RubyRunning the Ruby InterpreterInteractive Ruby (irb)Using a Shebang Comment on Unix/LinuxAssociating File Types on WindowsRuby’s KeywordsRuby’s OperatorsCommentsNumbersVariablesLocal VariablesInstance VariablesClass VariablesGlobal VariablesConstantsParallel Variable AssignmentSymbolsPredefined Global VariablesKeyword LiteralsGlobal ConstantsRangesMethodsBlock ArgumentsReturn ValuesMethod Name ConventionsDefault ArgumentsVariable ArgumentsAliasing MethodsBlocksProcsConditional StatementsFlow ControlThe if StatementThe unless StatementThe while StatementThe until StatementThe case StatementThe for LoopThe Conditional OperatorExecuting Code Before or After a ProgramClassesReopening a Ruby ClassInstance VariablesAccessorsClass VariablesClass MethodsSingletonsInheritanceAbstract ClassesAnonymous ClassesPublic, Private, and ProtectedModules and MixinsFilesCreating a New FileOpening an Existing FileARGV and ARGFRenaming and Deleting FilesFile InquiriesFile Modes and OwnershipThe IO ClassException HandlingThe rescue and ensure ClausesThe raise MethodThe catch and throw MethodsBasicObject ClassBasicObject Public Instance MethodsObject ClassObject Public Instance MethodsKernel ModuleString ClassString LiteralsString ConcatenationExpression SubstitutionGeneral Delimited StringsHere DocumentsEscape CharactersCharacter EncodingRegular ExpressionsString MethodsArray ClassCreating ArraysArray Class MethodsArray Instance MethodsHash ClassCreating HashesHash Class MethodsHash Instance MethodsTime Formatting DirectivesRuby DocumentationRubyGemsRakeRuby Resources