Programming

Ruby regular expressions (regex for short) let us find specific patterns in a chunk of data, with the intent of either extracting that data for futher processing or validating it. For example, think about an email address, with regular expressions we can define what a valid email address looks like. That will make our program […]

Read More

Sometimes you just want an object that can store some data for you, the struct class is very useful in that situation. Getting Started To create our Struct we pass in a series of symbols, which will become the instance variables of this class. They will have accessors defined by default (both for reading and […]

Read More

Data processing is a common task in programming. Data can come from many places: files, network, database, etc. In this post you will learn how to work with files and folders in Ruby. Reading files The file class allows you to open a file by simply passing in the file name to the open method: […]

Read More

Arrays are a fundamental data structure that stores data in memory. In Ruby you can store anything in an array, from strings to integers and even other arrays. The elements in an array are accessed using their index, which starts at 0. This is what an array containing the words “cat”, “dog” and “tiger” would […]

Read More

Do you want to create custom network clients and servers? Or just understand how it works? Then you will have to deal with sockets. Join me on this tour of ruby network programming to learn the basics, and start talking to other servers and clients using Ruby! So what are sockets? Sockets are the end […]

Read More