chore: sync content to repo (#9538)

Co-authored-by: kamranahmedse <4921183+kamranahmedse@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2026-01-13 15:03:30 +01:00
committed by GitHub
parent 6579be7215
commit e19ba12c03
100 changed files with 405 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Arithmetic Operators
Arithmetic operators are symbols that perform mathematical calculations on numerical values. These operators allow you to perform addition, subtraction, multiplication, division, and other common arithmetic operations. They take one or more operands (the values being operated on) and produce a result based on the operation performed.

View File

@@ -0,0 +1,3 @@
# Arrays
Arrays in Ruby are ordered collections of items. They can hold any type of data, including numbers, strings, symbols, or even other arrays. You create an array using square brackets `[]`, with elements separated by commas. Arrays are dynamic, meaning their size can change as you add or remove elements. You can access elements in an array using their index, starting from 0 for the first element.

View File

@@ -0,0 +1,3 @@
# Assignment Operators
Assignment operators in Ruby are used to assign values to variables. The most basic assignment operator is the equals sign (=), which assigns the value on the right-hand side to the variable on the left-hand side. Ruby also provides compound assignment operators that combine assignment with arithmetic or bitwise operations, such as +=, -=, *=, /=, and %=. These operators modify the variable's value by performing the specified operation with the right-hand side operand and then assigning the result back to the variable.

View File

@@ -0,0 +1,3 @@
# Attributes Accessors
Attributes accessors in Ruby provide a convenient way to access and modify the instance variables of a class. They automatically generate methods for reading (getting) and writing (setting) the values of these variables. The three main types are `attr_reader`, which creates a getter method; `attr_writer`, which creates a setter method; and `attr_accessor`, which creates both a getter and a setter method. These accessors simplify code and encapsulate the internal state of objects.

View File

@@ -0,0 +1,3 @@
# Exception Handling with `begin`, `rescue`, and `ensure`
Exception handling is a mechanism to deal with errors that occur during the execution of a program. In Ruby, the `begin`, `rescue`, and `ensure` keywords provide a structured way to handle these exceptions. The `begin` block encloses the code that might raise an exception. If an exception occurs, the `rescue` block catches and handles it. The `ensure` block, if present, guarantees that its code will always be executed, regardless of whether an exception was raised or not, making it suitable for cleanup operations.

View File

@@ -0,0 +1,3 @@
# Blocks
Blocks are chunks of code that can be passed to methods as if they were arguments. They are defined using either `do...end` or curly braces `{}`. Blocks are not objects themselves, but they can be converted into objects called Procs. Methods can then execute the code within the block using the `yield` keyword. Blocks are a fundamental part of Ruby's expressiveness, allowing for powerful iteration and control flow patterns.

View File

@@ -0,0 +1,9 @@
# Booleans
Booleans represent truth values: either `true` or `false`. They are fundamental for decision-making in Ruby code, allowing programs to execute different blocks of code based on whether a condition is true or false. Boolean values are the result of logical operations and comparisons.
Visit the following resources to learn more:
- [@article@Booleans - Odin Project](https://www.theodinproject.com/lessons/ruby-basic-data-types#booleans)
- [@article@True, False, and Nil](https://ruby-for-beginners.rubymonstas.org/built_in_classes/true_false_nil.html)
- [@video@True or False Booleans in Ruby for Beginners 4](https://www.youtube.com/watch?v=zzDNAu3IVpQ)

View File

@@ -0,0 +1,3 @@
# Break Statement in Ruby
The `break` statement in Ruby is a control flow tool used to exit a loop prematurely. When `break` is encountered within a loop (like `for`, `while`, `until`, or `each`), the loop's execution is immediately terminated, and the program continues with the next statement after the loop. It's useful for stopping a loop when a specific condition is met, preventing unnecessary iterations.

View File

@@ -0,0 +1,3 @@
# Bundler
Bundler is a dependency manager for Ruby. It ensures that an application uses the exact versions of gems (Ruby libraries) that it needs to function correctly. It tracks and installs the specific gem versions required by a project, creating a consistent environment across different machines and deployments. This prevents conflicts and ensures that the application behaves as expected, regardless of where it's run.

View File

@@ -0,0 +1,3 @@
# Byebug
Byebug is a powerful debugger for Ruby programs. It allows you to step through your code line by line, inspect variables, set breakpoints, and evaluate expressions in real-time. This helps you understand the flow of your program, identify the source of bugs, and fix them more efficiently.

View File

@@ -0,0 +1,3 @@
# Case Statements
A `case` statement in Ruby provides a way to execute different blocks of code based on the value of a variable or expression. It's an alternative to using multiple `if/elsif/else` statements, especially when you need to check for several different possible values. The `case` statement compares a given value against multiple `when` clauses, and executes the code block associated with the first matching clause. An optional `else` clause can be included to handle cases where none of the `when` clauses match.

View File

@@ -0,0 +1,3 @@
# Chaining Methods
Chaining methods in Ruby lets you call multiple methods on an object in a single line of code. This works because most methods in Ruby return an object (often `self`, the object the method was called on). By returning an object, the next method in the chain can be immediately called on the result of the previous method. This creates a fluent and readable way to perform a series of operations on a single object.

View File

@@ -0,0 +1,3 @@
# Closures
A closure is a block of code that can be passed around and executed later, even after the scope in which it was originally defined has ended. It "closes over" its surrounding environment, capturing the values of variables that were in scope when the closure was created. This allows the closure to access and use those variables even when it's executed in a different context.

View File

@@ -0,0 +1,9 @@
# Comments
Comments are notes in your code that the Ruby interpreter ignores. They're used to explain what the code does, making it easier for you and others to understand. You can create a single-line comment by starting a line with a `#`. For multi-line comments, you can use `=begin` and `=end` blocks; anything between these markers is treated as a comment.
Visit the following resources to learn more:
- [@official@Code Comments](https://docs.ruby-lang.org/en/master/syntax/comments_rdoc.html)
- [@article@How To Use Comments in Ruby](https://www.digitalocean.com/community/tutorials/how-to-use-comments-in-ruby)
- [@video@Comments | Ruby | Tutorial 25](https://www.youtube.com/watch?v=7wbX3OMgqn0)

View File

@@ -0,0 +1,3 @@
# Comparison Operators
Comparison operators are symbols used to compare two values. These operators evaluate to either `true` or `false` based on the relationship between the values being compared. Common comparison operators include equal to (`==`), not equal to (`!=`), greater than (`>`), less than (`<`), greater than or equal to (`>=`), and less than or equal to (`<=`).

View File

@@ -0,0 +1,3 @@
# Concurrency & Parallelism
Concurrency and parallelism are techniques for improving the performance and responsiveness of programs by executing multiple tasks seemingly or actually at the same time. Concurrency deals with managing multiple tasks within a single program, allowing them to make progress even if one task is blocked. Parallelism, on the other hand, involves physically executing multiple tasks simultaneously, typically by distributing them across multiple processor cores.

View File

@@ -0,0 +1,3 @@
# Conditional Statements
Conditional statements allow you to execute different blocks of code based on whether a certain condition is true or false. They provide a way to control the flow of your program, enabling it to make decisions and respond differently to various inputs or situations. Common conditional statements include `if`, `elsif`, `else`, and `unless`.

View File

@@ -0,0 +1,12 @@
# Constants & Variables
In Ruby, variables are named storage locations that hold data, and their values can be changed during the program's execution. Constants, on the other hand, are also named storage locations, but their values are intended to remain fixed throughout the program's runtime. While Ruby technically allows you to reassign a constant (it will issue a warning), the convention is to treat them as immutable values that should not be altered. Variables are typically named using snake_case, while constants are named using SCREAMING_SNAKE_CASE.
Visit the following resources to learn more:
- [@article@Variables](https://ruby-for-beginners.rubymonstas.org/variables.html)
- [@article@Ruby Variables](https://www.tutorialspoint.com/ruby/ruby_variables.htm)
- [@article@Everything You Need to Know About Ruby Constants](https://www.rubyguides.com/2017/07/ruby-constants/)
- [@article@Getting Started with Ruby Variables: A Beginners Guide](https://medium.com/@sz.soczewka/getting-started-with-ruby-variables-a-beginners-guide-d90a53eb5139)
- [@video@Variables | Ruby | Tutorial 6](https://www.youtube.com/watch?v=4mWc6Q9shcQ)
- [@video@Ruby Programming Tutorial - 20 - Constants](https://www.youtube.com/watch?v=qAqGIMKIMcA)

View File

@@ -0,0 +1,3 @@
# Date & Time
Date and Time represent specific points in time. They allow you to work with dates (year, month, day) and times (hour, minute, second) and perform operations like calculating durations, formatting dates for display, and comparing different points in time. They are essential for handling events, scheduling tasks, and managing temporal data.

View File

@@ -0,0 +1,3 @@
# Debug
`debug` is a powerful debugging tool integrated directly into Ruby. It allows developers to step through code execution, inspect variables, set breakpoints, and evaluate expressions in real-time. This helps in identifying and resolving errors or unexpected behavior within Ruby programs.

View File

@@ -0,0 +1,3 @@
# define_method
`define_method` is a method used to dynamically create new methods within a class or module. Instead of explicitly writing out the method definition with the `def` keyword, `define_method` allows you to generate methods at runtime, often based on data or logic that isn't known until the program is running. This provides a powerful way to reduce code duplication and create more flexible and adaptable code.

View File

@@ -0,0 +1,3 @@
# Defining Classes
A class is a blueprint for creating objects. It defines the attributes (data) and behaviors (methods) that objects of that class will possess. Defining a class involves specifying its name and the characteristics that its instances will have. This includes declaring instance variables to hold data and defining methods to perform actions on that data.

View File

@@ -0,0 +1,3 @@
# Defining Methods
Methods, also known as functions in other programming languages, are reusable blocks of code designed to perform a specific task. Defining a method involves specifying its name, the parameters it accepts (if any), and the sequence of instructions it executes. This allows you to organize your code into logical units, making it more readable, maintainable, and reusable throughout your program.

View File

@@ -0,0 +1,3 @@
# do/while Loops
`do/while` loops are a type of control flow statement that executes a block of code at least once, and then repeatedly executes the block as long as a specified condition is true. The condition is checked *after* the code block is executed, ensuring the block runs at least one time regardless of the initial state of the condition. This is different from a `while` loop, where the condition is checked *before* the code block is executed.

View File

@@ -0,0 +1,3 @@
# Each
`each` is a fundamental method in Ruby used to iterate over elements within a collection, such as an array or a hash. It applies a given block of code to each element in the collection, allowing you to perform operations on every item. The `each` method does not modify the original collection; it simply iterates through it.

View File

@@ -0,0 +1,3 @@
# Enumerable
Enumerable is a module in Ruby that provides a collection of useful iteration methods. It's designed to be mixed into classes that represent collections of data, such as arrays and hashes. By including Enumerable, a class gains the ability to iterate over its elements and perform operations like searching, filtering, sorting, and transforming data in a concise and readable way.

View File

@@ -0,0 +1,10 @@
# Everything is an Object
In Ruby, everything you encounter numbers, strings, arrays, even classes and methods is treated as an object. This means that each of these entities is an instance of a class and possesses both state (data) and behavior (methods) that can be invoked. This unified object model is a fundamental characteristic of Ruby's design.
Visit the following resources to learn more:
- [@article@Understanding the Ruby Object Model In Depth](https://www.honeybadger.io/blog/ruby-object-model/)
- [@article@Everything is object in Ruby](https://medium.com/@pk60905/everything-is-object-in-ruby-559475ce71dd)
- [@article@Ruby: Everything Is An Object?](https://reinteractive.com/articles/tutorial-series-new-to-rails/ruby-everything-is-an-object)
- [@video@Ruby Programming Tutorial - 9 - Everything is an Object!](https://www.youtube.com/watch?v=F75wFJIa368)

View File

@@ -0,0 +1,3 @@
# Fetching
`Enumerable` comes with some methods that allow you to retrieve elements from a collection based on specific criteria or conditions. This often involves iterating through the collection and selecting elements that meet a certain requirement, or accessing elements at specific indices. Methods like `find`, `select`, `detect`, and array-like indexing are commonly used to fetch elements from an `Enumerable` object.

View File

@@ -0,0 +1,3 @@
# Fibers
Fibers are a lightweight way to achieve concurrency. They are essentially blocks of code that can be paused and resumed, allowing you to switch between different execution contexts within a single thread. This enables cooperative multitasking, where the programmer explicitly controls when to switch between different parts of the program.

View File

@@ -0,0 +1,3 @@
# File I/O
File I/O involves reading data from and writing data to files. It allows your Ruby programs to interact with files on your computer's file system. You can open files, read their contents line by line or in chunks, write new data to them, or append data to existing files. This interaction is essential for tasks like reading configuration files, processing data from external sources, and saving program output.

View File

@@ -0,0 +1,10 @@
# Floats
Floats represent real numbers with fractional parts in Ruby. They are used to store numerical values that require more precision than integers can provide. Floats are typically represented using a decimal point or in scientific notation.
Visit the following resources to learn more:
- [@official@class Floar](https://docs.ruby-lang.org/en/master/Float.html)
- [@article@Numbers](https://ruby-for-beginners.rubymonstas.org/built_in_classes/numbers.html)
- [@article@Numbers - Odin Project](https://www.theodinproject.com/lessons/ruby-basic-data-types#numbers)
- [@video@03 Ruby Learning Path Integers and Floats](https://www.youtube.com/watch?v=FScOX-TavfA)

View File

@@ -0,0 +1,3 @@
# For Loop
The `for` loop in Ruby provides a way to iterate over a sequence of values, such as elements in an array or a range. It executes a block of code for each item in the sequence. While functional, the `for` loop is not as commonly used in Ruby as other iteration methods like `each`, `map`, or `select`, which are often considered more idiomatic and flexible.

View File

@@ -0,0 +1,3 @@
# Handling Exceptions
Exception handling is a mechanism to deal with errors that occur during the execution of a program. It involves identifying potential error-prone sections of code, anticipating possible exceptions, and implementing specific blocks of code to gracefully handle these exceptions, preventing the program from crashing and allowing it to continue execution or terminate in a controlled manner.

View File

@@ -0,0 +1,3 @@
# Ruby Hashes
Hashes are collections of key-value pairs. Think of them like dictionaries, where each word (the key) has a definition (the value). Keys are unique within a hash, and they are used to quickly access their corresponding values. Hashes can store any type of data as keys and values, making them a versatile way to organize and retrieve information.

View File

@@ -0,0 +1,3 @@
# Conditional Statements (if, elsif, else)
Conditional statements allow you to execute different blocks of code based on whether a certain condition is true or false. The `if` statement executes a block of code if a condition is true. The `elsif` statement (optional) allows you to check additional conditions if the initial `if` condition is false. The `else` statement (optional) provides a block of code to execute if none of the preceding conditions are true.

View File

@@ -0,0 +1,3 @@
# Interactive Ruby (irb)
Interactive Ruby (irb) is a command-line tool that allows you to execute Ruby code interactively. It provides a read-eval-print loop (REPL) environment where you can type in Ruby expressions, and irb will immediately evaluate and display the result. This makes it a valuable tool for experimenting with code, testing ideas, and quickly checking the behavior of Ruby methods and objects.

View File

@@ -0,0 +1,3 @@
# Inheritance
Inheritance is a fundamental concept in object-oriented programming where a new class (called a subclass or derived class) is created from an existing class (called a superclass or base class). The subclass inherits the properties and behaviors (attributes and methods) of the superclass, allowing it to reuse and extend the functionality of the existing class. This promotes code reusability and helps in creating a hierarchical structure of classes.

View File

@@ -0,0 +1,11 @@
# Installers
Installers are software packages designed to simplify the process of setting up Ruby on your computer. They typically handle downloading the necessary files, configuring your system environment, and ensuring that Ruby and its related tools are ready to use. Using an installer avoids the complexities of manual installation, making it easier for beginners to get started with Ruby development.
Visit the following resources to learn more:
- [@official@Installers - Ruby Docs](https://www.ruby-lang.org/en/documentation/installation/#installers)
- [@opensource@ruby-build (macOS, Linux, UNIX OS)](https://github.com/rbenv/ruby-build#readme)
- [@opensource@ruby-install (macOS, Linux, UNIX OS)](https://github.com/postmodern/ruby-install#readme)
- [@official@RubyInstaller (Windows)](https://rubyinstaller.org/)
- [@official@Ruby Stack](https://bitnami.com/stack/ruby/installer)

View File

@@ -0,0 +1,12 @@
# Installing Ruby
Installing Ruby involves setting up the Ruby interpreter and related tools on your system so you can run Ruby programs. This typically includes downloading a Ruby distribution, configuring your environment, and verifying the installation to ensure everything is working correctly. Different operating systems (like Windows, macOS, and Linux) have their own preferred methods for installing Ruby, often involving package managers or dedicated installers.
Visit the following resources to learn more:
- [@official@Installing Ruby](https://www.ruby-lang.org/en/documentation/installation/)
- [@article@Installing Ruby](https://www.theodinproject.com/lessons/ruby-installing-ruby)
- [@article@How to Install Ruby on Windows, macOS, and Linux](https://dev.to/luigi_ichi/how-to-install-ruby-on-windows-macos-and-linux-35o3)
- [@article@Setting up Ruby on WSL2 using Rbenv](https://codex.org/2022/08/19/setting-up-ruby-wsl2.html)
- [@video@Ruby Beginner Tutorial 2 | How To Install Ruby On Windows](https://www.youtube.com/watch?v=XC1ccTyhLPI)
- [@video@Ruby Beginner Tutorial 3 | How To Install Ruby On MacOS](https://www.youtube.com/watch?v=2pycF6hMy0s)

View File

@@ -0,0 +1,3 @@
# Instance Variables
Instance variables are variables that belong to a specific instance (object) of a class. Each object has its own set of instance variables, which can hold different values for each object. They store data that is unique to that particular object and define its state. Instance variables are typically accessed and modified through methods defined within the class.

View File

@@ -0,0 +1,10 @@
# Integers
Integers are whole numbers, meaning they don't have any fractional or decimal parts. They can be positive, negative, or zero. In programming, integers are used to represent countable quantities, indices, and other discrete values.
Visit the following resources to learn more:
- [@official@class Integer](https://docs.ruby-lang.org/en/master/Integer.html)
- [@article@Numbers](https://ruby-for-beginners.rubymonstas.org/built_in_classes/numbers.html)
- [@article@Numbers - Odin Project](https://www.theodinproject.com/lessons/ruby-basic-data-types#numbers)
- [@video@03 Ruby Learning Path Integers and Floats](https://docs.ruby-lang.org/en/master/Integer.html)

View File

@@ -0,0 +1,15 @@
# Ruby
Ruby is a dynamic, open-source programming language known for its simplicity and productivity. It emphasizes human readability, using a syntax that is easy to learn and write. Ruby is object-oriented, meaning everything is treated as an object, and it supports multiple programming paradigms, including procedural, object-oriented, and functional programming.
Visit the following resources to learn more:
- [@official@Ruby](https://www.ruby-lang.org/en/)
- [@official@Documentation](https://www.ruby-lang.org/en/documentation/)
- [@official@Ruby in Twenty Minutes](https://www.ruby-lang.org/en/documentation/quickstart/)
- [@article@Ruby Tutorial](https://www.tutorialspoint.com/ruby/index.htm)
- [@article@Learn Ruby Online](https://www.learnrubyonline.org/)
- [@book@The Ruby Programming Language](https://github.com/maniramakumar/the-best-ruby-books/blob/master/books/The%20Ruby%20Programming%20Language.pdf)
- [@video@Ruby Programming Language - Full Course](https://www.youtube.com/playlist?list=PL_EzhIKp343lBMH4UuklrMRL_WkilGoXe)
- [@video@Masterclass | Ruby Programming in 1 video | Beginners Ruby HandsOn Crash Course Interview FAQs |](https://www.youtube.com/watch?v=xyDoP5a_dvo)
- [@feed@Explore top posts about Ruby](https://app.daily.dev/tags/ruby?ref=roadmapsh)

View File

@@ -0,0 +1,3 @@
# Debugging with IRB
IRB (Interactive Ruby) is a powerful tool for debugging Ruby code. It allows you to execute Ruby code line by line, inspect variables, and test code snippets in real-time. This interactive environment helps you understand how your code behaves, identify errors, and experiment with different solutions without having to run your entire program. You can use IRB to step through your code, set breakpoints, and examine the state of your application at any point during execution.

View File

@@ -0,0 +1,3 @@
# Iterating with Enumerable
The `Enumerable` module in Ruby provides a collection of methods that allow you to traverse and process elements within a collection (like an array or hash). These iterating methods, such as `each`, `map`, `select`, and `reject`, simplify the process of performing actions on each item in the collection, transforming the collection, or filtering elements based on specific conditions. They abstract away the need for manual indexing and provide a more concise and readable way to work with collections.

View File

@@ -0,0 +1,3 @@
# Lambdas
Lambdas are anonymous functions, meaning they are functions without a name. They are objects in Ruby and can be treated like any other object, such as being passed as arguments to methods or stored in variables. Lambdas are defined using the `lambda` keyword or the shorthand `->` syntax, and they are similar to procs but differ in how they handle arguments and `return` statements.

View File

@@ -0,0 +1,3 @@
# Logical Operators
Logical operators are symbols or keywords used to combine or modify boolean expressions (true or false). They allow you to create more complex conditions in your code. Common logical operators include AND, OR, and NOT, which are used to determine the overall truthiness of a combined expression based on the truthiness of its individual parts.

View File

@@ -0,0 +1,7 @@
# Ruby Version Managers
Ruby version managers are tools that allow you to install and manage multiple versions of Ruby on the same system. This is useful because different projects may require different Ruby versions, and using a version manager prevents conflicts and simplifies switching between them. They typically work by modifying your shell environment to point to the desired Ruby installation.
Visit the following resources to learn more:
- [@official@Managers - Ruby Docs](https://www.ruby-lang.org/en/documentation/installation/#managers)

View File

@@ -0,0 +1,3 @@
# Metaprogramming
Metaprogramming is essentially writing code that manipulates other code. It allows you to define methods, classes, or even modify existing ones at runtime. This means your program can dynamically adapt and change its behavior based on conditions or data it encounters while running, rather than being fixed at compile time.

View File

@@ -0,0 +1,3 @@
# Method Lookup
Method lookup is the process a programming language uses to determine which method to execute when a method is called on an object. It involves searching through the object's class and its ancestors (inheritance hierarchy) to find the appropriate method definition. The search typically starts with the object's class and proceeds up the inheritance chain until a matching method is found.

View File

@@ -0,0 +1,3 @@
# Method Parameters
Method parameters are the values you pass into a method when you call it. There are several types: required parameters, which must be provided; optional parameters, which have default values if not provided; and variable-length arguments (using `*args`), which allow you to pass in an arbitrary number of arguments as an array. Keyword arguments (using `key: value`) allow you to pass arguments by name, and can also be required or optional. Block parameters (using `&block`) allow you to pass a block of code to a method.

View File

@@ -0,0 +1,3 @@
# method_missing
`method_missing` is a Ruby method that gets called when you try to invoke a method on an object that doesn't exist. Instead of raising a `NoMethodError`, Ruby gives you a chance to handle the missing method call yourself. This allows you to dynamically respond to method calls based on the method name and arguments provided, enabling flexible and expressive code.

View File

@@ -0,0 +1,3 @@
# Minitest
Minitest is a complete testing suite for Ruby. It provides support for test-driven development (TDD), behavior-driven development (BDD), mocking, and benchmarking. It's a lightweight and fast testing framework that's included in the Ruby standard library, making it readily available for use in Ruby projects without requiring additional installations.

View File

@@ -0,0 +1,3 @@
# Modules & Mixins
Modules in Ruby are collections of methods, classes, and constants. They provide a way to namespace and prevent naming conflicts. Mixins allow you to incorporate module functionality into classes, enabling code reuse and multiple inheritance-like behavior. By including a module in a class, the class gains access to the module's methods, effectively "mixing in" the module's functionality.

View File

@@ -0,0 +1,3 @@
# Monkey Patching
Monkey patching is a technique that allows you to add, modify, or replace existing code in a class or module at runtime. This means you can change the behavior of classes and modules, even those defined in external libraries, without directly altering their original source code. It's a powerful tool for extending functionality or fixing bugs, but it should be used with caution as it can lead to unexpected side effects and make code harder to maintain.

View File

@@ -0,0 +1,3 @@
# Mutex
A mutex (mutual exclusion) is a synchronization primitive that provides exclusive access to a shared resource. It essentially acts as a lock, ensuring that only one thread or process can access a critical section of code at any given time. This prevents race conditions and data corruption that can occur when multiple threads try to modify the same data simultaneously.

View File

@@ -0,0 +1,8 @@
# Naming Conventions
Naming conventions are a set of rules or guidelines for choosing names for variables, methods, classes, and other entities in a programming language. These conventions promote code readability, maintainability, and consistency across a project. Following a standard naming scheme helps developers understand the purpose and scope of different elements within the code, making it easier to collaborate and debug.
Visit the following resources to learn more:
- [@article@Ruby Naming Convention](https://namingconvention.org/ruby/)
- [@article@Naming conventions in Ruby language](https://dhanusir.com/ruby/section-two/naming-conventions/)

View File

@@ -0,0 +1,3 @@
# Next Keyword in Loops
The `next` keyword in Ruby provides a way to skip the current iteration of a loop and proceed directly to the next iteration. When `next` is encountered within a loop (like `for`, `while`, `until`, or iterators like `each`), the remaining code in the current loop cycle is bypassed, and the loop immediately begins its next cycle, if one exists. This is useful for skipping certain elements or conditions within a collection or range.

View File

@@ -0,0 +1,3 @@
# Nil
`nil` represents the absence of a value or a non-existent object. It's a special object in Ruby that signifies emptiness or the lack of a meaningful result. Think of it as a placeholder indicating that a variable or expression doesn't currently hold a valid value.

View File

@@ -0,0 +1,7 @@
# Package Managers
Package managers simplify the process of installing and managing software, including Ruby, on your system. Instead of manually downloading and configuring Ruby, you can use a package manager specific to your operating system. For example, on macOS, you might use Homebrew, while on Debian/Ubuntu Linux, you'd use apt. These tools handle dependencies and ensure Ruby is installed correctly, making the setup process much easier.
Visit the following resources to learn more:
- [@official@Package Management Systems](https://www.ruby-lang.org/en/documentation/installation/#package-management-systems)

View File

@@ -0,0 +1,3 @@
# Procs
A Proc in Ruby is an object that represents a block of code that can be stored, passed around, and executed later. Think of it as a named, reusable chunk of code. Unlike regular methods, Procs are objects, allowing them to be treated like any other variable, passed as arguments to methods, and stored in data structures. They capture the surrounding context in which they are defined, meaning they have access to variables and methods available at the time of their creation.

View File

@@ -0,0 +1,3 @@
# Pry
Pry is a powerful Ruby runtime developer console and an alternative to `irb`. It offers features like syntax highlighting, code browsing, documentation lookup, and the ability to step through code execution. Pry allows developers to pause program execution at any point, inspect variables, and even modify code on the fly, making it an invaluable tool for debugging and understanding Ruby code.

View File

@@ -0,0 +1,9 @@
# Puts, Print, and P
`puts`, `print`, and `p` are methods in Ruby used to display output to the console. `puts` prints the given arguments followed by a newline character, `print` prints the arguments as they are without adding a newline, and `p` prints a human-readable representation of the given object, which is useful for debugging.
Visit the following resources to learn more:
- [@article@Understanding The Differences Between Puts, Print & P](https://www.rubyguides.com/2018/10/puts-vs-print/)
- [@article@puts vs print vs p in Ruby](https://flexiple.com/ruby-on-rails/puts-vs-p-vs-print-ruby)
- [@video@Differences Between Print, Puts & P in Ruby](https://www.youtube.com/watch?v=9jSwVvyjAKE)

View File

@@ -0,0 +1,3 @@
# Querying
`Enumerable` comes with some methods that allow you to search and filter elements within a collection based on specific conditions. These methods return elements that match your criteria, providing a way to extract relevant data from a larger set. This allows you to efficiently find specific items or subsets of items within a collection without manually iterating through each element.

View File

@@ -0,0 +1,3 @@
# Rack
Rack provides a minimal interface between web servers and Ruby frameworks. By abstracting the connection between the server and the application, Rack allows developers to write Ruby web applications that can run on a variety of web servers with minimal configuration. It essentially provides a common API for handling HTTP requests and responses.

View File

@@ -0,0 +1,3 @@
# Ranges
Ranges in Ruby are used to create a sequence of values. They are defined using two endpoints, which can be numbers, characters, or any objects that can be compared using the `<=>` operator. Ranges can be inclusive (including the last value) or exclusive (excluding the last value), denoted by `..` and `...` respectively. They are commonly used for iterating over a sequence, creating subsets of arrays, and checking if a value falls within a specific interval.

View File

@@ -0,0 +1,3 @@
# Rbenv
Rbenv is a command-line tool that allows you to easily manage multiple Ruby environments (versions) on a single system. It works by intercepting Ruby commands and determining which Ruby version to use based on the current directory or a global setting. This enables you to work on different projects that require different Ruby versions without conflicts.

View File

@@ -0,0 +1,3 @@
# RDoc
RDoc is a documentation generator for Ruby source code. It parses Ruby files and creates HTML or other formatted documentation based on comments and code structure. It's the standard tool for generating API documentation for Ruby projects, allowing developers to easily understand and use libraries and applications.

View File

@@ -0,0 +1,3 @@
# Recursion
Recursion is a programming technique where a function calls itself within its own definition. This creates a loop-like behavior, but instead of using explicit loops (like `for` or `while`), the function breaks down a problem into smaller, self-similar subproblems until it reaches a base case, which stops the recursion and returns a value. The results from each recursive call are then combined to produce the final solution.

View File

@@ -0,0 +1,3 @@
# Redo
`redo` is a control flow statement in Ruby used within loops (like `for`, `while`, `until`) and iterators (like `each`, `map`). When `redo` is encountered, it restarts the current iteration of the loop or iterator from the beginning, without evaluating any remaining code in that iteration. It essentially repeats the current step.

View File

@@ -0,0 +1,3 @@
# Refinements
Refinements in Ruby provide a way to modify the behavior of a class or module within a specific scope, without affecting the global definition of that class or module. This allows you to introduce changes or extensions to existing code in a localized manner, preventing unintended side effects in other parts of your application. Refinements are particularly useful for managing dependencies and avoiding conflicts when working with shared code or libraries.

View File

@@ -0,0 +1,3 @@
# Regular Expressions in Ruby
Regular expressions (regex) are patterns used to match character combinations in strings. In Ruby, you can use regex to search, replace, or validate text within strings. They are defined using forward slashes (`/pattern/`) or the `%r{pattern}` syntax and provide a powerful way to manipulate and analyze text data based on specific patterns.

View File

@@ -0,0 +1,3 @@
# RSpec
RSpec is a testing tool for Ruby. It provides a domain-specific language (DSL) for writing tests in a clear and readable format. RSpec focuses on behavior-driven development (BDD), allowing developers to describe the expected behavior of their code in a way that is easy to understand and maintain.

View File

@@ -0,0 +1,3 @@
# RuboCop
RuboCop is a static code analyzer and formatter for Ruby. It inspects Ruby code and reports style issues, potential errors, and code smells based on a community-driven Ruby style guide. RuboCop can also automatically correct many of these issues, ensuring code consistency and improving overall code quality.

View File

@@ -0,0 +1,3 @@
# Ruby DSLs
A Domain Specific Language (DSL) is a programming language designed for a particular kind of application. Instead of being a general-purpose language that can solve a wide range of problems, a DSL is focused on solving problems in a specific domain, making code more readable and maintainable within that domain. Ruby's flexible syntax makes it well-suited for creating internal DSLs, which are DSLs implemented within Ruby itself, leveraging Ruby's features to create a more expressive and concise syntax for a specific task.

View File

@@ -0,0 +1,3 @@
# Ruby on Rails
Ruby on Rails is a server-side web application framework written in Ruby under the MIT License. Rails is a model-view-controller (MVC) framework, providing default structures for a database, a web service, and web pages. It encourages the use of web standards such as JSON or XML for data transfer, and HTML, CSS, and JavaScript for the user interface.

View File

@@ -0,0 +1,3 @@
# RubyGems
RubyGems is a package management system for the Ruby programming language. It provides a standard format for distributing Ruby programs and libraries (called "gems"), a tool for easily installing gems, and a central repository (RubyGems.org) for finding and sharing them. It simplifies the process of managing dependencies and distributing reusable code in the Ruby ecosystem.

View File

@@ -0,0 +1,3 @@
# RubyMine
RubyMine is an Integrated Development Environment (IDE) specifically designed for Ruby and Ruby on Rails development. It provides a comprehensive suite of tools for coding, testing, debugging, and deploying Ruby applications, aiming to enhance developer productivity through features like intelligent code completion, refactoring, and integration with various testing frameworks and version control systems.

View File

@@ -0,0 +1,10 @@
# Running Ruby
Running Ruby code involves executing instructions written in the Ruby programming language. This can be done through various methods, including using the Ruby interpreter directly from the command line, executing Ruby scripts, or running Ruby code within a web server environment like Rails. The interpreter reads and executes the code line by line, producing the desired output or performing the specified actions.
Visit the following resources to learn more:
- [@official@Ruby in Twenty Minutes](https://www.ruby-lang.org/en/documentation/quickstart/)
- [@article@Ruby Programming/Hello world](https://en.wikibooks.org/wiki/Ruby_Programming/Hello_world)
- [@article@How To Write Your First Ruby Program](https://www.digitalocean.com/community/tutorials/how-to-write-your-first-ruby-program)
- [@video@Ruby - Install and Hello World](https://www.youtube.com/watch?v=zmBNDZyYVpM)

View File

@@ -0,0 +1,3 @@
# RVM
RVM (Ruby Version Manager) is a command-line tool that allows you to easily manage multiple Ruby environments on a single system. It enables you to install, manage, and work with different Ruby versions (like Ruby 2.7, 3.0, or JRuby) and gemsets (isolated collections of gems) independently. This prevents conflicts between projects that require different Ruby versions or gem dependencies.

View File

@@ -0,0 +1,3 @@
# Scope
Scope refers to the visibility and accessibility of variables within different parts of a program. It determines where a variable can be accessed and used. Understanding scope is crucial for avoiding naming conflicts and ensuring that data is accessed and modified correctly within different parts of your Ruby code.

View File

@@ -0,0 +1,3 @@
# Search Algorithms
Search algorithms are methods used to find a specific element within a collection of data, like an array or a hash. These algorithms work by systematically checking each element in the data structure until the desired element is found or it's determined that the element is not present. Common examples include linear search, which checks each element sequentially, and binary search, which efficiently finds elements in sorted data by repeatedly dividing the search interval in half.

View File

@@ -0,0 +1,3 @@
# Searching and Filtering in Enumerable
`Enumerable` comes with some methods that allow you to select specific elements from a collection based on certain criteria. This allows you to extract subsets of data that meet your desired conditions, making it easier to work with large datasets or focus on relevant information. Common operations include finding the first element that satisfies a condition, selecting all elements that match a pattern, or rejecting elements that don't meet specific requirements.

View File

@@ -0,0 +1,3 @@
# Send
`send` in Ruby is a method that allows you to call other methods on an object dynamically by their name, which is passed as a symbol or string. It essentially bypasses the usual method call syntax, enabling you to invoke methods at runtime based on conditions or data. This provides a powerful way to write flexible and adaptable code.

View File

@@ -0,0 +1,3 @@
# Sinatra
Sinatra is a lightweight and flexible Domain Specific Language (DSL) for creating web applications in Ruby with minimal effort. It provides a simple way to map routes to Ruby code, allowing developers to quickly build web applications without the complexity of larger frameworks. Sinatra emphasizes convention over configuration, making it easy to get started and build small to medium-sized web applications.

View File

@@ -0,0 +1,3 @@
# Singleton Classes
A singleton class in Ruby is a special kind of class that is associated with a single object. It allows you to define methods that are specific to that particular object, without affecting other objects of the same class. Think of it as a way to add unique behavior to an individual object instance.

View File

@@ -0,0 +1,3 @@
# Sorting Algorithms
Sorting algorithms are methods used to rearrange a collection of items (like numbers, strings, or objects) into a specific order, such as ascending or descending. These algorithms work by comparing elements and swapping their positions until the entire collection is ordered according to the desired criteria. Different sorting algorithms have varying efficiencies and are suitable for different types and sizes of data.

View File

@@ -0,0 +1,3 @@
# Sorting in Enumerable
The `Enumerable` module in Ruby provides several methods for sorting collections. These methods allow you to arrange elements in ascending or descending order based on their natural ordering or a custom comparison logic. The most common sorting methods include `sort`, which returns a new sorted array, and `sort_by`, which sorts based on the result of a block applied to each element. You can also use `min`, `max`, `minmax` to find the smallest, largest, or both smallest and largest elements in a collection, respectively.

View File

@@ -0,0 +1,3 @@
# Stacks & Queues
Stacks and queues are fundamental data structures used to manage collections of items. A stack operates on the Last-In, First-Out (LIFO) principle, where the last element added is the first one removed, like a stack of plates. Conversely, a queue follows the First-In, First-Out (FIFO) principle, where the first element added is the first one removed, similar to a waiting line. In Ruby, these can be implemented using arrays or custom classes to manage data in a specific order.

View File

@@ -0,0 +1,3 @@
# Standard
Standard is a Ruby gem that automatically formats and lints Ruby code, aiming to enforce a consistent style across projects. It combines the functionality of linters like RuboCop with an auto-formatter, providing a single tool to ensure code adheres to a predefined set of style rules. By automatically fixing style issues, Standard helps developers focus on writing code rather than debating formatting preferences.

View File

@@ -0,0 +1,11 @@
# Strings
Strings are sequences of characters used to represent text. They are a fundamental data type for storing and manipulating textual information. Strings can contain letters, numbers, symbols, and spaces, and are typically enclosed within single or double quotes.
Visit the following resources to learn more:
- [@official@class String](https://docs.ruby-lang.org/en/master/String.html)
- [@article@Strings](https://ruby-for-beginners.rubymonstas.org/built_in_classes/strings.html)
- [@article@Strings - Odin Project](https://www.theodinproject.com/lessons/ruby-basic-data-types#strings)
- [@video@Working With Strings | Ruby | Tutorial 8](https://www.youtube.com/watch?v=9HB4iIAxuh0)
- [@video@Strings and Variables in Ruby for Beginners 2](https://www.youtube.com/watch?v=cSwq_lcCs78)

View File

@@ -0,0 +1,3 @@
# Symbols
Symbols are lightweight, immutable strings often used as identifiers or names within a Ruby program. Unlike regular strings, symbols are guaranteed to be unique; Ruby only creates one copy of a symbol, regardless of how many times it's referenced. This makes them efficient for tasks like hash keys or representing states, where comparing identity is more important than comparing content. They are typically written with a colon prefix, like `:my_symbol`.

View File

@@ -0,0 +1,3 @@
# Test::Unit
Test::Unit is a testing framework for Ruby, providing a structure for writing and running tests. It allows developers to define test cases as methods within classes, making it easy to organize and execute tests to verify the correctness of their code. Test::Unit includes assertions to check expected outcomes and report failures, helping ensure code quality and reliability.

View File

@@ -0,0 +1,3 @@
# Threads
Threads are a way to achieve concurrency within a single process. They allow multiple parts of a program to execute seemingly simultaneously by sharing the same memory space. This can improve performance by utilizing multiple CPU cores or by allowing a program to remain responsive while performing long-running tasks.

View File

@@ -0,0 +1,3 @@
# Times Loop
The `times` method in Ruby is a simple way to execute a block of code a specified number of times. It's called on an integer, and the block is executed that many times, with an optional block variable representing the current iteration number (starting from zero). It provides a concise way to repeat actions without needing to explicitly manage a counter variable.

View File

@@ -0,0 +1,3 @@
# Type Casting
Type casting, also known as type conversion, is the process of changing a value from one data type to another. This is often necessary when you need to perform operations that require specific data types or when you want to represent data in a different format. For example, you might need to convert a string representation of a number into an actual integer or float to perform mathematical calculations.

View File

@@ -0,0 +1,3 @@
# Unless
`unless` is a conditional statement in Ruby that executes a block of code only if a specified condition is false. It's essentially the opposite of `if`. If the condition provided to `unless` evaluates to false, the code block is executed; otherwise, the code block is skipped. It provides a more readable way to express negative conditions.

View File

@@ -0,0 +1,3 @@
# Until Loop
The `until` loop in Ruby executes a block of code as long as a specified condition is false. It repeatedly runs the code within the loop until the condition becomes true. Think of it as the opposite of a `while` loop; where `while` loops continue as long as the condition is true, `until` loops continue as long as the condition is false.

View File

@@ -0,0 +1,3 @@
# VS Code Ruby Extension
The VS Code Ruby extension enhances the Visual Studio Code editor with features specifically designed for Ruby development. It provides functionalities like syntax highlighting, code completion, debugging support, linting, and formatting, making it easier for developers to write, test, and maintain Ruby code within the VS Code environment. This extension streamlines the development workflow and improves code quality by offering real-time feedback and assistance.

View File

@@ -0,0 +1,3 @@
# While Loops in Ruby
A `while` loop in Ruby repeatedly executes a block of code as long as a specified condition is true. It checks the condition before each iteration, and if the condition is false from the start, the code block is never executed. This makes it suitable for situations where you want to execute code an unknown number of times until a certain condition is met.

View File

@@ -0,0 +1,3 @@
# YARD
YARD (Yet Another Ruby Documentation) is a documentation generation tool for the Ruby programming language. It allows developers to create comprehensive and consistent documentation for their Ruby projects by parsing source code and extracting information based on specially formatted comments. YARD generates output in various formats, including HTML, making it easy to browse and share project documentation.