The Notes for Professionals book is compiled from Stack Overflow Documentation, the content is written by the beautiful people at Stack Overflow. Text content is released under Creative Commons BY-SA. See credits at the end of this book whom contributed to the various chapters. Images may be copyright of their respective owners unless otherwise specified
Book created for educational purposes and is not affiliated with group(s), company(s) nor Stack Overflow. All trademarks belong to their respective company owners
https://goalkicker.com/
Content
1-1
Content list
1-2
About
1-3
Chapter 1: Getting started with Ruby Language
1-4
Section 1.1: Hello World
1-5
Section 1.2: Hello World as a Self-Executable File—using Shebang (Unix-like operating systems only)
1-6
Section 1.3: Hello World from IRB
1-7
Section 1.4: Hello World without source files
1-8
Section 1.5: Hello World with tk
1-9
Section 1.6: My First Method
1-10
Chapter 2: Casting (type conversion)
1-11
Section 2.1: Casting to a Float
1-12
Section 2.2: Casting to a String
1-13
Section 2.3: Casting to an Integer
1-14
Section 2.4: Floats and Integers
1-15
Chapter 3: Operators
1-16
Section 3.1: Operator Precedence and Methods
1-17
Section 3.2: Case equality operator (===)
1-18
Section 3.3: Safe Navigation Operator
1-19
Section 3.4: Assignment Operators
1-20
Section 3.5: Comparison Operators
1-21
Chapter 4: Variable Scope and Visibility
1-22
Section 4.1: Class Variables
1-23
Section 4.2: Local Variables
1-24
Section 4.3: Global Variables
1-25
Section 4.4: Instance Variables
1-26
Chapter 5: Environment Variables
1-27
Section 5.1: Sample to get user profile path
1-28
Chapter 6: Constants
1-29
Section 6.1: Define a constant
1-30
Section 6.2: Modify a Constant
1-31
Section 6.3: Constants cannot be defined in methods
1-32
Section 6.4: Define and change constants in a class
1-33
Chapter 7: Special Constants in Ruby
1-34
Section 7.1: __FILE__
1-35
Section 7.2: __dir__
1-36
Section 7.3: $PROGRAM_NAME or $0
1-37
Section 7.4: $$
1-38
Section 7.5: $1, $2, etc
1-39
Section 7.6: ARGV or $*
1-40
Section 7.7: STDIN
1-41
Section 7.8: STDOUT
1-42
Section 7.9: STDERR
1-43
Section 7.10: $stderr
1-44
Section 7.11: $stdout
1-45
Section 7.12: $stdin
1-46
Section 7.13: ENV
1-47
Chapter 8: Comments
1-48
Section 8.1: Single & Multiple line comments
1-49
Chapter 9: Arrays
1-50
Section 9.1: Create Array of Strings
1-51
Section 9.2: Create Array with Array::new
1-52
Section 9.3: Create Array of Symbols
1-53
Section 9.4: Manipulating Array Elements
1-54
Section 9.5: Accessing elements
1-55
Section 9.6: Creating an Array with the literal constructor [ ]
1-56
Section 9.7: Decomposition
1-57
Section 9.8: Arrays union, intersection and dierence
1-58
Section 9.9: Remove all nil elements from an array with #compact
1-59
Section 9.10: Get all combinations / permutations of an array
1-60
Section 9.11: Inject, reduce
1-61
Section 9.12: Filtering arrays
1-62
Section 9.13: #map
1-63
Section 9.14: Arrays and the splat (*) operator
1-64
Section 9.15: Two-dimensional array
1-65
Section 9.16: Turn multi-dimensional array into a one-dimensional (flattened) array
1-66
Section 9.17: Get unique array elements
1-67
Section 9.18: Create Array of numbers
1-68
Section 9.19: Create an Array of consecutive numbers or letters
1-69
Section 9.20: Cast to Array from any object
1-70
Chapter 10: Multidimensional Arrays
1-71
Section 10.1: Initializing a 2D array
1-72
Section 10.2: Initializing a 3D array
1-73
Section 10.3: Accessing a nested array
1-74
Section 10.4: Array flattening
1-75
Chapter 11: Strings
1-76
Section 11.1: Dierence between single-quoted and double-quoted String literals