Ruby ist eine der wichtigsten Programmiersprachen im Bereich der Webentwicklung. Sie ist die Grundlage des Rails-Frameworks, auf dem einige der wichtigsten Websites im Internet basieren. Ruby ist eine vollständig objektorientierte Sprache. Die Kombination der Mächtigkeit einer rein objektorientierten Sprache mit dem Komfort einer Skriptsprache macht Ruby zu einem beliebten Werkzeug für Programmierer, die Dinge schnell und sauber erledigen wollen. In diesem Kurs lernen Sie die wichtigsten Standardbibliotheksmodule, eingebauten Klassen und Module. Der Kurs umfast alle neuen und geänderten Syntax und Semantiken, die durch Ruby 3.2 eingeführt wurden, einschließlich Pattern-Matching und Ractors, und beschreibt die Sprache bis Ruby 3.2.
More with Less: Code the Way You Want- Get Ruby
- Use Ruby
- Math operations and comparisons
- Variables
- Method arguments
- The opposite of "if” is "unless”
- Loops
- Defining methods
- Parameters
- Return values
- Designing a class
- Attribute writers and readers
- Errors—the "emergency stop” button
- Defining a subclass
- Adding methods to subclasses
- Overriding methods
- The "super” keyword
- The Object class
- Overriding the inherited method
- An Employee class
- Division with Ruby’s
- Formatting numbers for printing
- Call other methods on the same instance with "self”
- Inheritance and "initialize”
- Accessing arrays
- Blocks
- Blocks and variable scope
- Opening the file
- Safely closing the file, with a block
- Blocks have a return value
- Making one array based on another, using "map”
- Hashes
- Normalizing hash keys
- Using hashes as method parameters
- The heap
- Aliasing
- Hash default blocks
- Using modules as mixins
- Mixins and method overriding
- the Comparable mixin
- Constants
- The Comparable mixin
- The Enumerable module
- Ruby’s core classes and modules
- Documentation
- Listing available classes and modules
- Arguments and locks in call signatures
- Class method documentation
- Where Ruby docs come from: rdoc
- Using "raise” to report errors
- Exceptions: When something’s gone wrong
- Ruby’s search for a rescue clause
- Exception classes
- Automated tests find your bugs before someone else does