Learn to Code with Ruby | Discount Coupon for Udemy Course
A comprehensive introduction to coding with the Ruby programming language. Complete beginners welcome! | Discount Coupon for Udemy Course
bestseller- 32 hours hours of on-demand video
- 10 article
- Full lifetime access
- Access on mobile and TV
- Certificate of completion
- 7 additional resources
- Learn to program in the Ruby programming language
- Master common Ruby objects like Strings, Arrays, Hashes, and more
- Solve popular coding challenges and algorithms with Ruby
- Dive into object-oriented programming including classes and more
The most comprehensive Ruby course available on Udemy! An in-depth overview of coding with Ruby, a popular programming language renowned for its simplicity and elegance. Whether you've never written a line of code before or are looking to learn a brand new language, this course covers all bases! Learn to Code with Ruby offers more than 30+ hours of video tutorials, 250+ lectures, and dozens of quizzes and exercises to test your knowledge as you proceed through the course. Lessons include: Installation and configuration for both Mac OS and Windows systemsCommon programming concepts (variables, arithmetic, output)Objects and methodsStringsNumbersBooleansMethods and ConditionalsRangesArraysHashesBlocks, Procs, and LambdasDates and timesFile Input and OutputRegular ExpressionClasses, Modules, and Inheritance and more! Ruby is a language released by Yukihiro Matsumoto in 1995 that bills itself as "a programmer's best friend". Every aspect of Ruby is designed to make programming easier for the developer. There is no better first language if you're interested in learning how to program. Ruby also serves as the foundation for Ruby on Rails, a popular web framework that powers over 1.2 million websites worldwide. The course offers an extensive introduction to the base language you'll need to know if you intend to tackle web development in the future. Check out the sample videos below to get a taste of what the course has to offer! So if you're ready to commit yourself, if you're eager to expand your knowledge of programming, if you're ready to discover what makes this elegant language so loved by developers, you are ready to Learn to Code with Ruby! Thanks for checking out the course!Who this course is for:Beginning programmers who want to start with an easy, human-friendly languageIntermediate coders who are interested in exploring the Ruby language in greater depthWeb development folk curious about the foundation of Ruby on Rails
Course Content:
Sections are minimized for better readability, click the section title to view the course content
- Welcome to Ruby [SLIDES]08:09
Welcome to Learn to Code with Ruby! In this lesson, we introduce the language, its history, and some of its advantages/disadvantages relative to other languages.
- Object-Oriented Programming [SLIDES]05:41
Learn about object-oriented programming (OOP), a paradigm that views a software program as a collection of objects that interact with one another. Practice applying OOP principles to real-world objects.
- Ruby Installation Instructions01:11
In this lesson, we discuss how to install the latest version of Ruby.
- macOS - Access and Work with the Terminal09:46
In this lesson, we access the Terminal application on a Mac, which is used to issue text commands to the operating system. We explore popular commands like pwd, ls, and cd to traverse directories and explore their contents.
- macOS - Install XCode Command Line Tools03:22
In this lesson, we'll install the XCode Command Line Tools, a technical prerequisite for installing Ruby on a macOS computer.
- macOS - Install Homebrew03:05
In this listen, we install Homebrew, a software package manager for macOS. We run Homebrew from our Terminal and use it to download/install applications.
- macOS - Install rbenv07:39
In this lesson, we install the rbenv Ruby version manager, which enables us to download and install multiple versions of Ruby on the same machine.
- macOS - Install Ruby06:38
In this lesson, we use rbenv to install Ruby on our macOS operating systems. We target the latest version of Ruby at the time of installation.
- macOS - Install VSCode Text Editor04:42
In this lesson, we download Visual Studio Code, the free text editor in which we'll be writing our Ruby code throughout the course. We also discuss the benefits of using such a tool.
- Windows - Access and Work with PowerShell09:26
In this lesson, we introduce the PowerShell command-line application and some common commands including ls for listing files/folders and cd for directory navigation.
- Windows - Figure Out if System is 32-bit or 64-bit01:19
In this lesson, we use our system settings to determine if our Windows version is 32-bit or 64-bit.
- Windows - Install Ruby06:36
In this lesson, we walk through the process of installing Ruby on a Windows machine. We also use Powershell to confirm the language was installed properly.
- Windows - Install VSCode Text Editor03:39
In this lesson, we download Atom, the text editor in which we'll be writing our code throughout the course. We also discuss the benefits of using such a tool.
- Install VSCode Extensions04:51
- Add VSCode to Your System PATH01:05
In this lesson, we'll add VSCode and its corresponding Terminal command, code, to our system PATH, which enables the Terminal to locate the software from any directory on our computer.
- Download Course Materials02:12
Download the course materials for the course in a single zip file.
- Write First Ruby File and Run with Code Runner08:55
In this lesson, we write our first Ruby program, which outputs the text Hello World to the screen.
- Write First Ruby File and Run with Terminal or PowerShell04:31
In this lesson, we learn how to run our Ruby file using the ruby program from our Terminal.
- Interactive Ruby (IRB)05:04
In this lesson, we dive into Interactive Ruby (IRB), a REPL (Read Evaluate Print Loop) program for playing around with the Ruby programming language.
- Section Review [SLIDES]03:52
In this optional lesson, we'll review the concepts we introduced in this course section.
- The puts Method10:09
In this lesson, we'll learn more about the puts method, which outputs text to the Terminal/output when the program runs. The puts method adds a line break to the end of the output. Like other methods in Ruby, it can be invoked with and without parentheses. We can also use commas to output multiple elements with the put method; Ruby will separate each one with a line break.
- Escape Characters08:13
In this lesson, we'll introduce escape characters, which are special symbols we can use in a Ruby string. Escape characters add special effects like line breaks, tabs, and symbols/characters to a string. We escape the expected pattern of output, which is Ruby outputting the literal characters that we've typed.
- The print Method03:08
In this lesson, we introduce the print method, another way to output text to the screen. The print method is similar to puts but it does not add a line break to the end of the output.
- The p Method06:22
In this lesson, we learn about the p method, which outputs a "technical" version of the object/output. For example, the p method will print a string with double quotes around the content. It exists primarily for the benefit of developers.
- Comments06:30
In this lesson, we'll learn how to use comments to ask Ruby to ignore specific lines of code. We create a comment with a hashtag/octothorpe (#) symbol. We can place the hashtag at the beginning of a line or after a line of valid Ruby code. Comments enable developers to leave explanations, metadata, annotations, diagrams, jokes, and more in their program.
- Outputting Text1 question
- Multiline Comments02:12
In this lesson, you'll how to create multiline comments using =begin and =end.
- Integers and Floating Point Numbers04:14
In this lesson, we'll discuss the differences between integers and floating-point numbers and their syntax in Ruby.
- Basic Arithmetic in Ruby08:47
In this lesson, we'll learn the symbols for mathematical operations including addition, subtraction, multiplication, division, and modulo.
- String Concatenation03:30
In this lesson, we'll learn how to concatenate (join) two strings together using the + operator.
- Intro to Exceptions: TypeError08:01
In this lesson, we'll learn about errors/exceptions in Ruby including TypeError, which Ruby raises when we provide an invalid type of object for an operation.
- Output and Arithmetic10 questions
Review the concepts introduced so far in this section of the course.
- Section Review [SLIDES]07:09
Review everything we learned in this section of the course including output methods, comments, exceptions, concatenation, and more.
- Variables [SLIDES]09:43
In this lesson, we'll learn about variables. A variable is a name we assign to a value in our program that is subject to change over time.
- Declaring Variables11:07
Declare various variables in a .rb file and use them in expressions throughout the program.
- Variable Declaration1 question
- Coding Exercise Solution: Variable Declaration00:13
See the solution to the previous coding challenge.
- Exceptions: NameError03:14
Describe the NameError exception, which Ruby raises when it cannot recognize a name in your program.
- Parallel Variable Assignment03:41
Declare multiple variables and provide initial values to them on a single line.
- Swapping Variable Values03:54
Given two variables, swap the values they store.
- Assignment Shortcuts07:47
Use shortcuts to perform an operation on a variable's value and assign the result back to the original variable.
- Constants05:36
Learn to declare constants, which are names for values that will not change over the program's execution.
- Section Review [SLIDES]06:14
Review everything we've learned in this course section including variables, constants, parallel variable assignment, and more!
- Note on Atom vs. VSCode00:44
Explain the differences between the Atom and VSCode text editors and why the lessons up ahead may look different.
- Intro to Object Methods08:07
- Begin our exploration of methods on various Ruby objects. A method is simply a message sent to an object
- Start discussion of return values, the final output of a method
- Intro to Object Methods1 question
- Coding Exercise Solution: Intro to Object Methods00:12
See the solution to the previous coding challenge.
- Return Values and the nil Object09:14
- Continue discussion of return values from objects
- Introduce the nil object which represents nothingness, blankness, or the absence of a value
- String Interpolation10:24
- Utilize string interpolation to inject variables or calculations into a string
- Practice the interpolation syntax -- a hashtag followed by curly braces (#{})
- The gets Method and the chomp Method15:24
- Use the gets method to collect input from the user
- Use the chomp method to chop off the newline from the end of a string
- Write a program to collect input from the user and print it out to them
- Variables, Constants, Object Methods, Return Values, String Interpolation7 questions
Review the concepts introduced so far in this section of the course
- Intro to Numbers and the class Method07:49
- Call the .class method to return the class of the object, the blueprint from which it is built
- Convert Numbers to Strings and Vice Versa08:34
- Utilize methods like to_s and to_s to convert numeric objects to strings and vice versa
- Intro to Booleans04:50
- Learn about a new object type called a Boolean, which represents either true or false
- The odd? and even? Predicate Methods05:49
- Explore predicate / Boolean methods available on objects which always return a true or false
- Call the odd? and even? methods on integer objects to see if they are odd or even
- Comparison with the Equality (==) Operator06:41
- Use the equality operator ( == ) to test whether two objects are equal
- Comparison with the Inequality (!=) Operator04:34
- Use the inequality operator ( != ) to test whether two objects are NOT equal
- Boolean Values, Predicate Methods, Equality and Inequality5 questions
Review the concepts introduced so far in this section of the course.
- Less than and Greater than Operators05:15
- Use the < and > operators to compare whether one number is less than or greater than another
- Explore the related <= and >= operations to test less than / greater than or equal to
- Arithmetic Methods and Basic Arguments09:07
- Dive behind the scenes to see how Ruby processes basic arithmetic methods
- Begin a deep dive into arguments, which are inputs passed to a method call
- Intro to Object Methods with Parameters (The .between? Predicate Method)08:22
- Continue exploration of parameters and arguments in more detail
- Call the between? predicate method to test whether a number falls in between two others
- Float Methods06:48
- Call some exclusive methods available on Float objects, which include a decimal component
- Assignment Operators07:54
- Use a popular programming shortcut to perform a mathematical operation on a variable and overwrite the variable's value
- Introduction to Blocks with the .times Method14:33
- Call the .times method on an integer to repeat a certain operation that number of times.
- Introduce the concept of blocks, an attachment to a method call that modifies its functionality
- The upto and downto Methods09:42
- Call the .upto and .downto methods on an integer to iterate from that number to another
- Further enhance our knowledge of blocks and block variables
- BONUS - The step Method07:39
- Call the .step method on an integer to iterate from that number to another at a frequent interval
- Further enhance our knowledge of blocks and block variables
- Object Methods, Parameters and Arguments, Float Methods, and Blocks5 questions
Review the concepts introduced so far in this section of the course.
- Create a String07:25
- Practice multiple syntactical options for creating a new String object.
- Call common methods like .length and .class on String objects.
- Multiline Strings04:02
- Use multiline strings to create strings that utilize more than one line.
- Single Quotes vs Double Quotes02:20
- Learn the differences between using single vs. double quotes for creating strings.
- Double-quoted strings allow for interpolation and escape characters.
- Equality and Inequality Operators with Strings07:12
- Review the equality (==) and inequality (!=) operators
- Use the two operators on String objects
- Concatenate Strings07:44
- Add / concatenate one string to another with concatenation operators / methods
- The .length and .size Methods06:02
- Call the .length or .size method to return the numbers of characters in the string
- See what happens when the methods are called on an empty string
- Extract Single Characters from String with Bracket Syntax07:45
- Use bracket syntax to extract a single character from a string
- Extract Multiple Characters from String with Bracket Syntax04:09
- Use bracket syntax with a few tweaks to extract multiple sequential characters from a string
- Extract Multiple Characters with Range Objects05:54
- Introduce the Range object which represents an interval of numbers or characters
- Feed the range to the bracket syntax to extract sequential characters from a string
- Overwrite Characters in String with Bracket Syntax05:14
- Combine bracket syntax from previous lessons with the assignment operator (=) to mutate a string by assigning new characters
- Case Methods05:43
- Call the .downcase, .upcase, .capitalize, and .swapcase methods to modify the casing of a string
- The methods each return a new String object
- The .reverse Method on a String03:10
- Call the .reverse method on a String to reverse the order of its characters
- Bang Methods on Strings07:20
- Introduce bang methods, which mutate the original object the method is called on
- Bang methods are an alternative to reassigning the return value of a method call to the same variable
- The .include? Method on a String05:32
- Call the .include? predicate method to check if a certain substring is found in the string
- The .empty? and .nil? Methods on a String04:01
- Call the .empty? predicate method to check if a string contains no characters
- Call the .nil? method which returns true only if called on a nil object
- Common String Methods10 questions
Review the concepts introduced so far in this section of the course.
- Intro to Methods12:57
- Introduce the purpose and syntax of a method.
- Transition to Atom Text editor and write our first method.
- Local Variables04:16
- Define local variables within a method.
- Local variables disappear as soon as the method is done executing.
- Parameters and Arguments09:16
- Add one or more arguments to a method to allow for input when the method is invoked
- A parameter is the name for an expected method argument
- Return Values I07:23
- Return a value from a custom method
- Differentiate between an explicit and implicit method return
- Return Values II - Default Return Values and the Return of the puts Method06:14
- Discover the default return value of a method
- Explore why nil is the return value of the puts method
- The if Statement10:19
- Use the if statement, our first conditional, to evaluate code only if a condition evaluates to true
- Truthiness and Falsiness07:06
- Explore the concept of truthiness and falsiness in Ruby.
- false and nil are falsy in Ruby.
- All other objects are truthy.
- if elsif09:02
- Add an elsif statement to check for the truthiness of another condition.
- Structure the code to follow a more complex logical path
- The else Keyword08:01
- Fallback on the else keyword to execute code if no if or elsif condition above is met
- Multiple Conditions with && Operator12:48
- Employ the AND operator (&&) to check for multiple conditions in an if or elsif statement
- Multiple Conditions with || Operator05:10
- Employ the OR operator (||) to check if either one of two or more conditions is true.
- Truthiness and Falsiness8 questions
Review the concepts introduced so far in this section of the course.
- Parentheses and Precedence08:33
- Add parentheses when using && and || operators to establish the precedence for evaluating a condition
- Nested if Statements08:04
- Nest an if statement inside another to create a more complex logical path
- The .respond_to? Method09:29
- Call the .respond_to? predicate method to test whether an object can respond to a specific method
- Ternary Operator12:36
- Consolidate a simple if / else design by replacing it with the terser ternary operator
- Default or Optional Parameters06:24
- Provide default / optional parameters to methods that will activate if the arguments are not passed on a method call
- Call A Method from Another Method or Interpolated String10:35
- Invoke one method from the body of another
- Invoke a method from inside a string using interpolation syntax
- The case Statement12:03
- Replace longwinded if / elsif / else statements with the case statement
- Negation with !06:09
- Utilize the exclamation point (!) to negate the value of an object and convert it to a Boolean
- Use two exclamation points (!!) to return the Boolean representation of an object.
- The unless Keyword07:44
- Use the unless keyword to simulate an "execute if false" condition for a piece of code.
- The while Keyword15:38
- Begin discussion of a loop, an iteration that is repeated a specified number of times
- Introduce the while keyword for looping while a condition is true
- The until Keyword04:20
- Continue discussion of loops and iterations
- Introduce the until keyword for looping until a condition is true
- CHALLENGE: FizzBuzz11:56
- Tackle Fizzbuzz, a popular coding challenge for beginners
- Statement Modifiers / Inline Modifiers05:36
- Replace simple if and unless statements with shorter inline statements
- The end keyword is not required with this simplified format
- Conditional Assignment06:34
- Assign a value to a variable only if it is currently set to nil.
- Explore the advantages of this approach in professional code.
- The case statement, Negation, the unless, while, and until Keywords, and More!5 questions
Review the concepts introduced so far in this section of the course.
- Intro to Ranges07:45
- Introduce the Ruby Range object for storing an interval or sequence of numbers / characters
- Call the .class, .first, and .last methods on a Range object
- Dynamic Range1 question
- Coding Exercise Solution: Dynamic Range00:14
See the solution to the previous coding challenge.
- Alphabetical Ranges05:36
- Generate a Range object of alphabetic characters
- Explore the caveats of uppercase and lowercase character ranges
- The size Method on a Range01:45
- Call the .size method on a Range object to see the size of its interval
- Check if Value Exists in a Range with include? Method or ===04:24
- Use the .includes? predicate method to see if a value falls between a Range
- Use the === syntax to see if a value falls between a Range
- Generate A Random Number with the rand Method05:57
- Explore the Ruby rand method to generate a random floating point number or integer
- Provide the method a Range argument to get a number in between the interval
- Range Objects3 questions
Review the concepts introduced so far in this section of the course.
- Introduction to Arrays03:59
- Explain the Array object, a container to store other objects in a sequenced order.
- Create an empty array and call the .class method on it.
- Create An Array with Bracket Syntax09:17
- Instantiate multiple arrays full of different data types.
- Nest one array within another.
- Shorthand %w Syntax to Create an Array of Strings02:10
- Utilize the %w syntax to easily generate an array of strings.
- Elements in the brackets are written without quotes or commas.
- CODING CHALLENGE: Create an Array1 question
- Create an Array with Array.new Method03:31
- Utilize the Array.new method to create a new array.
- Populate a new array with a consistent set of values.
- Access Single Array Element by Index Position11:57
- Use square bracket syntax to select an element from an array.
- The first array element will have an index position of 0.
- Access Single Array Element with .fetch Method04:08
- Call the .fetch method on an array to extract an element by index position.
- Compare the differences between square bracket syntax and .fetch
- Indexing into Arrays1 question
- Coding Exercise Solution: Indexing into Arrays00:37
See the solution to the previous coding challenge.
- Extract Sequential Array Elements with Bracket Syntax06:11
- Extract multiple array elements with square bracket syntax
- Choose a starting point and the number of elements to select
- Access Sequential Array Elements with a Range Object04:01
- Feed a Range object to square brackets to extract multiple array elements.
- Review the differences between an inclusive and exclusive range.
- Access Multiple Array Elements with the .values_at Method05:00
- Call the .values_at method on an array to extract non-sequential array elements.
- Extract an array element more than once.
- The slice Method02:33
- Call the .slice method as an alternative to using square bracket syntax for array element extraction.
- Overwrite One or More Array Elements08:06
- Extract one or more array elements with familiar [] or .slice syntax.
- Overwrite the array element(s) with the equal sign (the assignment operator).
- The length, size and count Methods on an Array04:56
- Call the .length, .size, or .count methods to return the number of elements in an array.
- An empty array will return 0.
- The empty? and nil? Methods on an Array05:17
- Call the .empty? method which returns true if the array has no elements
- Call the .nil? method which returns true if called on a nil object.
- The first and last Methods11:11
- Call the .first and .last elements on an array to return the first and last elements.
- Call the two methods with an optional numeric argument to return an array of results.
- The push Method, the Shovel Operator, and the insert Method07:04
- Call the .push method to add an element to the end of an array.
- Use the shovel operator (<<) to accomplish the equivalent of the .push method
- Call the .insert method to insert an element in a specific index position.
- The pop Method05:15
- Call the .pop method to remove an element from the end of the array.
- The .pop method also returns the element itself.
- The shift and unshift Methods03:16
- Call the .shift method to remove an element from the beginning of the array.
- Call the .unshift method to add an element to the beginning of the array.
- Equality and Inequality Operators with Arrays05:05
- Use the equality (==) and inequality (!=) operators to compare two arrays
- The Spaceship Operator06:14
- Use the spaceship operator (<=>) to compare two arrays together.
- -1 will be returned if the array on the left is less than the one on the right.
- 0 will be returned if the two array are equal.
- 1 will be returned if the array on the left is greater than the one on the right.
- Convert Ranges to Arrays with the to_a Method04:18
- Call the .to_a method on a Range object to convert it to an array
- The .is_a? Predicate Method12:46
- Call the .is_a? predicate method on a variety of objects to test whether they inherit functionality from a specific class.
- The method will return true for an object's class or any of the superclasses above it.
- Arrays I - Creation, Addition, and Modification10 questions
Review the concepts introduced so far in this section of the course.
- The ri Program07:48
- Use the ri program from the Command Line to retrieve documentation on a Ruby class or an instance method
- Review of Blocks05:19
- Review blocks, which are attachments to methods that modify how they function.
- Review the two syntax options for a block (curly braces and do end).
- The each Method on an Array06:59
- Call the .each method on an array to iterate over its elements one by one
- Provide the .each method a block to specify what to do on each iteration
- More Practice with the .each Method12:59
- Provide block variables to an .each method block to represent the current array element being iterated over.
- each within each04:02
- Nest an .each method call within another .each method.
- The For Loop09:31
- Utilize the for loop to iterate over an array.
- Compare the differences between for and the .each method.
- See why the .each method is strongly preferred.
- The .each_with_index Method06:35
- Call the .each_with_index method to iterate over an array while keeping track of the index position.
- Provide a second block variable to hold the place of each index position.
- CHALLENGE: The .each_with_index Method07:02
- Tackle a programming problem that involves the .each_with_index method on an array.
- The .map and .collect Methods on an Array12:14
- Call the .map or .collect method to iterate over an array, apply an operation to each element, and return a new array of the resulting elements.
- Practice the method with another challenge.
- Iteration over Array with while or until Loops05:35
- Use the while and until loops as an alternative approach to iterate over array elements.
- The break Keyword06:19
- Use the break keyword to break out of loop if a condition is met on an iteration.
- The next Keyword03:37
- Use the next keyword to continue to the next iteration of a loop if a condition is met.
- The .reverse Method on an Array02:24
- Call the .reverse method on an array to rotate it, to present its elements in the opposite order.
- The .sort Method on an Array05:17
- Call the .sort method to sort the elements in an array.
- The results will be in ascending order if an array consists of numeric element.
- The results will be in alphabetical order if an array consists of strings.
- The .concat Method on an Array04:46
- Call the .concat method on an array to merge it with another array.
- The .max and .min Methods on an Array09:06
- Call the .max method on an array to return its largest element.
- Call the .min method on an array to return its smallest element.
- The .include? Predicate Method on an Array02:11
- Call the .include? predicate method on an array to test whether it includes a value.
- The .index and .find_index Methods on an Array02:51
- Call the .index or .last_index method on an array to return the index position of the first occurrence of the argument.
- The methods will return nil if the element does not exist.
- The .select Method on an Array06:45
- Call the .select method on an array to return an array of elements for which the block condition evaluates to true.
- The .reject Method on an Array02:53
- Call the .reject method on an array to return only those elements that do not fit the block condition.
- Unpack a Multidimensional Array05:44
- Place multiple variables on the left side of an assignment operator to unpack a multi-dimensional array and assign each nested element to a variable.
- The .partition Method on an Array05:04
- Combine the functionalities of the .select and .reject methods in the .partition method, which returns a multidimensional array.
- Evens and Odds1 question
- Arrays II - Iteration and Various Methods9 questions
Review the concepts introduced so far in this section of the course.
- The .split Method on a String05:27
- Call the .split method on a string to separate it by the occurrence of a delimiter and return an array of the results.
- Longest word in a string1 question
- Iterate over String Characters04:40
- Iterate over a string's characters by calling the .split or .chars method and then the .each method on the result array.
- An alternative is the .each_char method on the string.
- The .join Method on an Array10:30
- Call the .join method on an array to combine each of its elements and separate each with a delimiter.
- The .count Method on a String06:44
- Call the .count method on a string to return the number of times a substring appears in the string.
- The .index and .rindex Methods on a String12:36
- Call the .index method to return the first index position where the substring is found.
- Call the .rindex method to return the last index position where the substring is found.
- Emulate the functionality of the .index method with our own custom method.
- The .insert Method on a String02:29
- Call the .insert method to insert a character or characters at a specified index position in a string.
- The .squeeze Method11:21
- Call the .squeeze method to remove all characters that occur two or more times in sequence.
- The .clear Method on a String01:26
- Call the .clear method on a string to rid it of content and return an empty string.
- The .delete Method on a String05:36
- Call the .delete method to remove all occurrences of the substring characters from the original string.
- Strings II5 questions
Review the concepts introduced so far in this section of the course.
- Object Pointers and Object Copies10:30
- Review the idea of variables serving as pointers or references to objects
- Invoke the .dup method on an object to create a duplicate copy of the object.
- Splat Arguments03:50
- Use splat arguments in a method definition to allow for any number of arguments.
- The .any? and .all? Methods on an Array04:26
- Call the .any? and .all? predicate methods on array with a block argument specifying a condition.
- The methods return true if any or all of the blocks return true.
- The .find and .detect Methods on an Array05:41
- Call the .find or .detect methods to return the first element of the array that matches the block's condition.
- The .uniq Method on an Array05:28
- Call the .uniq method on an array to remove all of its duplicates.
- Emulate the .uniq functionality in our own custom method.
- The .compact Method on an Array04:42
- Call the .compact method to return a new array without any nil elements.
- Emulate the functionality in our own custom method.
- The .inject and .reduce Methods on an Array11:51
- Call the .inject or .reduce methods to iterate over array while keeping track of the return values of the previous iterations.
- The .flatten Method on an Array03:47
- Call the .flatten method on array to remove all nested arrays.
- The .zip Method on an Array07:04
- Call the .zip method to sync up elements across two or more arrays based on a common index position.
- Emulate this functionality in a custom method.
- The .sample Method on an Array03:49
- Call the .sample method to extract a random element from the array.
- Provide a numeric argument to extract multiple elements.
- Multiply an Array with Asterisk Symbol05:58
- Repeat the elements in an array by multiplying it with the asterisk symbol.
- Union - Combine Arrays and Exclude Duplicates06:32
- Create a union between two arrays that includes all items found in either (no duplicates included).
- Remove Array Items that Exist in Another Array05:51
- Use the subtraction operator to remove array items that exist in another array.
- Array Intersection with the Ampersand Symbol06:06
- Use the & operator to identify elements common to two or more arrays.
- Arrays III - Bonus Methods7 questions
Review the concepts introduced so far in this section of the course.
- Intro to Hashes07:08
- Dive into hashes, a special object for storing key-value pairs that resembles a real-life dictionary
- Create Hash and Extract Values from Hashes by their Keys09:54
- Create hashes in Atom and extract values using square bracket syntax.
- Intro to Symbols and Symbols as Hash Keys08:17
- Introduce the Symbol object, a lightweight string used to represent a name.
- Use symbols as the keys within a hash.
- Convert Symbols to Strings and Vice Versa03:51
- Call the .to_s and .to_sym methods to convert symbols to strings and vice versa.
- The .fetch Method on a Hash05:00
- Call the .fetch method to extract a value from a hash.
- The method returns nil by default if a key is not found.
- The return value in case of key absence can be customized.
- Add a Key Value Pair to a Hash with Bracket Syntax or the .store Method05:01
- Use square bracket syntax or call the .store method to add a key-value pair to a hash.
- The length and empty? Methods on a Hash03:21
- Call the .length method to return the number of key-value pairs
- Call the .empty? method to test whether the hash has no key-value pairs
- The each Method on a Hash07:18
- Iterate over a hash with the .each method.
- The block will require two block variables, one for the key and the other for the value.
- Count of values in a Hash1 question
- The each_key and each_value Methods07:16
- Invoke the .each_key and .each_value methods to iterate over just the keys or just the values of a hash.
- Retrieve Keys or Values from Hash as an Array02:11
- Call the .keys or .values methods to return arrays that contain only the keys or only the values from the hash.
- Hashes I5 questions
Review the concepts introduced so far in this section of the course.
- Create Hash with Default Value05:36
- Create a Hash object with a default value.
- See the advantages of not using the standard nil.
- Convert Hash to Array and Vice Versa05:11
- Call the .to_a method on a hash to convert it to an array.
- See how Ruby uses a multi-dimensional array to maintain the connections betweens keys and values.
- The sort and sort_by Methods on a Hash06:44
- Call the .sort and .sort_by methods to sort a hash by its keys or values.
- The return value will always be a new array object.
- The key? and value? Methods on a Hash04:33
- Call the .key? and .value? predicate methods to test whether a key or value exists in the hash.
- The .has_key? and .has_value? methods are also available but these are deprecated.
- Hashes as Method Arguments10:20
- Explore the advantages of passing a hash as an argument to a method.
- A hash allows the values to be used in any order, which reduces error.
- Omit curly braces from hash when it is the last method argument.
- The delete Method on a Hash03:08
- Call the .delete method on a hash to remove a key-value pair based on a key argument.
- The select and reject Methods on a Hash06:46
- Call the .select and .reject methods on a hash to extract key-value pairs whether either the key, the value, or both match a condition
- The .merge Method to Combine Hashes07:59
- Call the .merge method on one hash to merge another hash into it
- Values from the second hash will overwrite those in the first if keys are identical.
- CHALLENGE: Word Frequency in a Sentence String09:29
- Tackle another Ruby programming problem!
- Count the number of times each word appears in a sentence
- Hashes II4 questions
Review the concepts introduced so far in this section of the course.
- Introduction to Blocks07:50
- Dive into a fresh unit on blocks, procs and lambdas.
- Offer a quick review of blocks
- The yield Keyword09:54
- Use the yield keyword within a method definition to transfer control to a block
- The yield keyword can be used more than once.
- Procs I17:25
- Create a Proc, an object that functions as a saved block.
- Procs begin with Proc.new and otherwise use identical syntax to blocks.
- The .block_given? Method03:27
- Use the .block_given? predicate method to yield control to a block only if a block is given to the method call.
- Yielding with Arguments08:37
- Yield arguments to the block following a method call
- Use familiar syntax (vertical pipes) to work with the arguments within the block body.
- A Custom .each Method08:52
- Implement a custom .each method by utilizing a loop and yielding control of each array element to a block.
- Procs II04:14
- Call a Proc object independently with the .call method
- Pass a Proc to a method that does not expect it as an argument
- Pass a Ruby Method as Proc05:52
- Learn a shorthand syntax for passing a Ruby method like to_s or to_i as a Proc to another method.
- Methods with Proc Parameters06:35
- Formally add an expected Proc argument to a method definition.
- Create two different Procs and pass them to our method calls.
- Intro to Lambdas12:52
- Introduce the lambda object, which operates similarly to a Proc.
- Differentiate between the Proc and lambda objects.
- Lambda Efficiency Example13:11
- Walk through a refactoring example that utilizes lambdas to make a program tighter, terser and more adaptable to future change
- Intro to the Time Object06:46
- Explore the Time object which represents dates and times
- Call the .new and .now class methods on the Time class to create a few Time instances.
- Instance Methods on a Time Object04:22
- Call multiple time and day-related methods on a Time object including .year, .month, .wday, and .yday.
- Predicate Methods on Time Objects04:31
- Call predicate methods on Time object including the day of week methods and the .dst? method.
- Add or Subtract Time by Seconds08:58
- Use addition and subtraction operators on a Time object.
- Durations should be expressed in seconds.
- The Comparable Methods on a Time Object06:20
- Call the methods mixed into the Time class from the Enumerable module.
- These include .between?, <, <=, >, and >=.
- Convert Time Object to Other Objects05:02
- Call the .to_s, .ctime, and .to_a methods on a Time object to convert it to various other data types.
- Convert Time Object to Formatted String05:31
- Call the .strftime method with a special syntax to convert a Time object to a string in a specific format.
- The .parse and .strptime Methods07:40
- Call the .parse and .strptime methods to convert a string input into a valid Time object.
- The latter method requires a special syntax to designate the format that the Ruby interpreter should expect.
- Read from a Text File with Ruby04:17
- Call the File.open class method to read a text file into Ruby.
- Write to a Text File with Ruby04:48
- Call the File.open class method with an optional w argument to write to a text file using Ruby.
- Rename and Delete a File with Ruby03:39
- Invoke the File.rename and File.delete methods to rename and delete a file using Ruby.
- Utilize the File.exists? predicate method to check for the existence of a file before performing an operation.
- Command Line Arguments (ARGV)03:41
- Pass in arguments to a Ruby program through the Command Line.
- Use the ARGV array to capture and interact with command line arguments.
- The load Method04:53
- Call the .load method to run another Ruby file in the present file.
- The require and require_relative Methods07:35
- Call the .require and .require_relative methods to import another Ruby file into the current program.
- The .require method looks by default in the Ruby installation directory. Alter this with ./ syntax.
- The .require_relative method looks in the current directory.
- The .start_with? and .end_with? Methods15:54
- Call the .start_with? and .end_with? predicate methods to test whether a substring exists at either the beginning or end of a string.
- The .include? Method10:31
- Invoke the .include? predicate method to test whether a substring is found anywhere within a string.
- Intro to Regular Expressions10:16
- Utilize the basic syntax of regular expressions (RegEx) to search for character matches within a string.
- The .scan Method I06:26
- Call the .scan method to return an array of all matches of the regular expression in a string.
- The .scan Method II06:17
- Explore the finer details of .scan including the provision of blocks to the method invocation.
- The Wildcard Symbol06:29
- Use the period (.) to represent a wildcard, an occurrence of any character in a string.
- The Backslash05:31
- Understand the special use cases of a backslash in regular expressions.
- The backslash can be used to indicate digits, whitespace and more.
- RegEx Anchors04:06
- Utilize characters to search for a RegEx match at the beginning or end of a string.
- Exclude Characters04:39
- Use the caret symbol (^) to exclude characters from a RegEx search.
- The .sub and .gsub Methods with Regular Expressions09:59
- Call the .sub and .gsub methods to find and replace either the first or all occurrences of a RegEx match in a string.
- Utilize the bang versions of these methods.
- Rubular.com07:20
- Navigate to Rubular.com, a popular resource for experimenting with Ruby regular expressions in your browser.
- Intro to Classes11:23
- Discuss the idea of an object and its blueprint, the class
- Understand the concept of an object's state, which is held by its instance variables
- Review of the .class Method on Ruby Objects02:53
- Call the .class method on any Ruby object to return the class (blueprint) from which it is made.
- The .superclass and .ancestors Methods on a Class14:31
- Call the .superclass method on a class to return its superclass, the class from which it inherits.
- Call the .ancestors method on a class to return an array of all superclasses and modules above it.
- The .ancestors method also represents the method lookup path, the order in which Ruby will look for an instance method on an object.
- The .methods Method08:27
- Call the .methods method on an object to return an array of all methods that can be called on the object.
- Create A Class12:06
- Transition to Atom and create our first class definition.
- Create a Class1 question
- Object Aliases05:14
- Review the idea of variables serving as object pointers or references
- Assign one variable to another to show how this operates.
- Instance Variables and the .initialize Method13:34
- Define the .initialize method to set the object's initial state upon instantiation.
- Declare instance variables with default values within the definition.
- Create Classes with Instance Variables1 question
- Instance Methods10:04
- Define instance methods on the class. These will be available on all objects instantiated from the class.
- Instance Methods1 question
- Override the .to_s Method05:41
- Define a custom .to_s method that will override the method inherited from the Object class.
- The to_s Method1 question
- The self Keyword in an Instance Method05:44
- Use the self keyword within an instance method definition to refer to the object at hand.
- Call instance methods on the object from within another instance method.
- Getter Methods10:35
- Define getter / reader methods to access the value of instance variables.
- Setter Methods10:53
- Define setter / writer methods to set a new value for instance variables.
- Shortcut Accessor Methods08:36
- Use Ruby's shorthand syntax for declaring getter and setter methods to replace our dense code.
- Three options are available: attr_writer, attr_reader, and attr_accessor.
- Add Parameters to initialize Method07:58
- Modify our initialize definition in the Gadget class to include arguments.
- These arguments are passed when the .new class method is called on the class.
- Classes I4 questions
Review the concepts introduced so far in this section of the course
- Intro to Modules10:35
- Define a module with a constant and three methods.
- Identify the benefits of using modules, a toolbox of related functionality.
- Modules with Identical Methods08:07
- Define multiple modules with identically named methods.
- See how modules create a protected namespace around each method.
- Import Modules into the Current File03:42
- Review the require method to import a Ruby file into the present one.
- The Math Module02:52
- Call methods from Ruby's built in Math module.
- Mixins I - The Comparable Module18:02
- Explore Ruby's built in Comparable module, which is mixed into various classes to add compare functionality.
- Mix in the module into a new OlympicMedal class to allow comparisons.
- Mixins II - Custom Mixins15:24
- Define a custom Purchaseable module
- Mix in the module into multiple classes, including a superclass.
- The .ancestors Method in Depth09:54
- Review the .ancestors method that is called on a class.
- Explore the method lookup path, the order in which Ruby looks for a method among superclasses and mixins.
- The prepend Keyword04:12
- Use the prepend keyword in place of include to make a mixin's methods override those defined on a class.
- The extend Keyword04:54
- Use the extend keyword to add a module's methods to the class rather than its objects.
- Mixins III - The Enumerable Module14:51
- Conclude with another built-in Ruby module, Enumerable, which grants access to over 50 methods related to iteration.
- Modules and Mixins4 questions
Review the concepts introduced so far in this section of the course.
- Private Methods10:28
- Define private methods on a class definition.
- Private methods cannot be called from outside the object.
- Protected Methods11:39
- Define protected methods on a class definition.
- Protected methods can only be called from within the object or by an object made from the same clas.
- Add Validation to Setter Methods09:39
- Validate that the input to a method is valid before modifying the object's state.
- Prefer Instance Methods to Instance Variables10:41
- Refactor our Gadget class to rely on instance methods to access instance variables.
- This approach is more future-proof.
- Calling Multiple Setter Methods within one Method07:55
- Define a reset method to alter multiple instance variables at once by calling numerous setter methods.
- Structs12:16
- Create a Struct, a lightweight class-like object that includes only instance variables.
- Integrate an AppStore module into the Gadget class definition.
- Monkey Patching I13:04
- Use monkey patching to add new methods to Ruby's existing Array and String classes.
- Monkey Patching II15:10
- Use monkey patching to add new methods to Ruby's existing Hash and Fixnum classes.
- Monkey Patching III06:04
- Monkey patch a custom class after an object has been instantiated to see the impact of the class modification.
- Class Variables and Class Methods14:25
- Define class methods and class variables which will exist on the class instead of objects created from the class.
- Classes II5 questions
Review the concepts introduced so far in this section of the course.
- Review of Inheritance04:02
- Introduce inheritance, superclasses, and subclasses
- Create Subclasses06:20
- Create a superclasses and two subclasses that inherit from it.
- Check Inheritance Hierarchy06:54
- Use < syntax to test whether a class inherits from another.
- Review the .ancestors method on a class.
- The .is_a? and .instance_of? Predicate Methods05:21
- Call the .is_a? method to test if an object inherits from the class passed as the argument.
- Call the .instance_of? method to test if an object is directly instantiated from the class passed as the argument.
- Exclusive Instance Methods in Subclasses05:21
- Define exclusive methods on subclasses.
- These will only exist on objects created from the subclass, not anywhere else.
- Override Methods in a Subclass04:52
- Define a method on a subclass that overrides the same method on a superclass.
- The super Keyword I10:29
- Use the super keyword in a subclass method to invoke the same method in the superclass.
- The super Keyword II07:59
- Explore three different ways to use super:
- without parentheses
- with parentheses and no arguments
- with parentheses and arguments
- Explore three different ways to use super:
- Class Variables across Subclasses07:52
- See how class variables can be used across subclasses to test how many instances of each class have been created.
- Singleton Classes and Singleton Methods08:28
- Declare a singleton method which will only exist on one instance of a class.
- A separate singleton class is created behind the scenes to contain this method.
- Hash as initialize Argument I07:06
- Modify the initialize method to expect a hash as an argument.
- See the advantages of this design approach.
- Hash as initialize Argument II09:08
- Continue refactoring the code from the previous lesson to make the class design even more adaptable to a hash argument.
- Classes III6 questions
Review the concepts introduced so far in this section of the course.
- Intro to Rubydoc Documentation05:44
- Navigate across the RubyDoc.info site to look up documentation for various objects and instance methods.
- Class Method Documentation on RubyDocs05:17
- Navigate across the RubyDoc.info site to look up documentation for various class methods.
- Install rdoc00:05
- Use rdoc to Generate Your Own Documentation I08:27
- Use rdoc to generate automatic browser-based documentation for a Ruby project.
- Use rdoc to Generate Your Own Documentation II05:47
- Add comments to Ruby code to allow rdoc to process it as documentation.
- Run rdoc to see the updated documentation.
- Conclusion02:03
- Celebrate finishing the 30+ hour course!
- Bonus!00:23
Explore the bonus content for the course!
JOIN OUR WHATSAPP GROUP TO GET LATEST COUPON AS SOON AS UPDATED
JOIN WHATSAPPJOIN OUR TELEGRAM CHANNEL TO GET LATEST COUPON
JOIN TELEGRAMJOIN OUR FACEBOOK GROUP TO GET LATEST COUPON
JOIN FACEBOOKFree Online Tools And Converters for your use
URL Encoder
Input a string of text or a URL and encode the entered string
Try itURL Decoder
Input an encoded string of text or a URL and decode the entered string
Try itColor Contrast Checker (WCAG)
Calculate the color contrast ration for your website (WCAG)
Try itXML Formatter
Paste or upload an XML and have it formatted to a beautiful XML format
Try itURL Slug Generator
Convert any title or sentence into a variety of slugs for your pages URL
Try itE-Signature
Draw an e-signature or type a signature for your online signature
Try it