#### Overview of this book

Ruby is a powerful, general-purpose programming language that can be applied to any task. Whether you are an experienced developer who wants to learn a new language or you are new to programming, this book is your comprehensive Ruby coding guide. Starting with the foundational principles, such as syntax, and scaling up to advanced topics such as big data analysis, this book will give you all of the tools you need to be a professional Ruby developer. A few of the key topics are: object-oriented programming, built-in Ruby methods, core programming skills, and an introduction to the Ruby on Rails and Sinatra web frameworks. You will also build 10 practical Ruby programs. Created by an experienced Ruby developer, this book has been written to ensure it focuses on the skills you will need to be a professional Ruby developer. After you have read this book, you will be ready to start building real-world Ruby projects.
Preface
Free Chapter
Introduction to the Ruby Programming Language
Ruby Variables
Ruby Strings
Working with Numbers in Ruby
Ruby Iterators and Loops
Ruby Collections
Ruby Conditionals
Working with the Filesystem in Ruby
Error Handling in Ruby
Regular Expressions in Ruby
Searching with grep in Ruby
Ruby Gems
Ruby Web Frameworks
Working with APIs in Ruby
Machine Learning

# Implementing a factorial algorithm

Another interesting problem that we are going to tackle is how to calculate the factorial digit sum. In this program, we need to solve this: find the sum of the digits in the number 100.

This is a perfect problem to build a solution for because it combines a number of topics that we have learned in this Ruby programming course. I would even suggest you try building the program yourself before we head to the solution as this will give you a hands-on feel of Ruby algorithm development. You have all the knowledge needed to build it.

If you get stuck, don't worry! We will still build it together.

If you're new to factorials, the question is self-explanatory. A factorial is a number that is the multiplied value of itself as well as all the digits up to 1. Factorials can get quite massive in a short period of time because they are a compounded...