Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Blog Directory  >  Software Blogs  >  Programming Blogs  >  Black Bytes programming Blog  > 

Black Bytes Blog


blackbytes.info
Ruby Programming tips & tutorials with a focus on easy to understand content.
2020-05-12 17:44
What is a Ruby hash? A hash is a data structure used to store data in the form of UNIQUE key-value pairs. Unlike arrays, there are no numerical indexes, you access the hash values with keys… Read More
2020-03-09 21:08
You may be learning Rails & you read that you have to create a “scaffold” to get your Rails application started. Easy! You can do this using the rails g scaffold command. But… Read More
2020-02-17 18:06
Did you know that you can navigate your file system with Ruby? With the Ruby “Dir” class. You can list directory entries, change your current directory & even create new fold… Read More
2020-02-04 15:21
How do you move from Java to Ruby? In this guide, you’ll learn what are the major differences between the two languages to help you make the jump. It’s great for the many people… Read More
2020-01-06 17:39
What are helpers in Rails? A helper is a method that is (mostly) used in your Rails views to extract reusable code. Rails comes with a set of useful built-in helper methods. One of these bui… Read More
How To Use Flash Messages In Rails
2019-11-18 18:40
What are flash messages? A flash message is a way to communicate information with the users of your Rails application so they can know what happens as a result of their actions. Example mess… Read More
2019-10-28 15:52
A queue is like a waiting list. Imagine you’re waiting in line to buy the latest Apple product, getting a movie ticket, or to pay for your groceries. These are queues! You can use queu… Read More
2019-10-14 15:04
What is a scope in Rails & why is it useful? Well… Scopes are custom queries that you define inside your Rails models with the scope method. Every scope takes two arguments: A nam… Read More
2019-10-07 16:18
Learning Ruby can be overwhelming with all the bits & pieces you have to remember. That’s why I put together this syntax reference for you! It will help refresh your memory & q… Read More
2019-08-26 14:36
How do we bring together multiple source code files into one? We require them. This tells Ruby to look for a file & run the code inside it. But sometimes we don’t need to load thes… Read More
2019-05-06 14:02
Creating a temporary file gives you an empty file with a random name inside your O.S. (Operating System) temporary folder. This file gets deleted automatically. How can you do this in Ruby?… Read More
2019-04-01 12:55
The ultimate goal of your Ruby on Rails application is to render a view. A view is what the user sees. It’s the culmination of all the work your app has to do, combining logic, data &a&hell…Read More
2019-03-11 15:01
The normal flow of visiting a website is that you load a page & if you want to see new information you have to either reload the page to update it, or click a link to visit a different p… Read More
2019-02-25 16:23
One way to learn new Ruby tricks, patterns & methods is to read code others have written. But where do you find interesting code worth reading? We have many open source projects, and cod… Read More
2019-02-22 15:42
A Ruby class helps you define a blueprint for objects. Objects are the products of the class. So what is an object? An object is an individual “thing”, with its own identity &amp&hell…Read More
2019-02-18 15:01
Rake is a popular task runner in Ruby. What is a task? Making a backup of your database Running your tests Gathering & reporting stats These are small tasks that without Rake would be sc… Read More
2019-02-15 13:39
What is a boolean? A boolean is a value used in a logic statement to say if something is considered true or false. This can be used to make decisions. In Ruby we don’t have a Boolean c… Read More
2019-02-08 14:56
You’re going to be spending a lot of your time as a developer inside the editor, so it important to use an editor that you’re comfortable & productive with. In this article:… Read More
2019-02-01 16:42
You can use a Ruby comment to add information to your code that may be helpful for you or other developers. The most common type of comment is the single-line comment. Here’s the synta… Read More
2019-01-28 16:15
Looking for some new & interesting gems to try? Then have a look at dry-rb, a set of gems that bring solutions to common problems. Dry-rb is composed of over 18 Ruby gems that can work t… Read More
2019-01-25 16:24
The initialize method is part of the object-creation process in Ruby & it allows you to set the initial values for an object. In other programming languages they call this a “const… Read More
2019-01-21 16:00
Do you need to know math to become a good programmer? It depends! If you’re just going to be writing CRUD apps all day then you probably don’t need to know much math, if any. But… Read More
2019-01-11 13:57
Inheritance is a fundamental OOP feature that allows you to create a more specific & specialized version of a class. Here’s an example: Food -> Fruit -> Orange There’s… Read More
2019-01-03 16:18
A matrix is a 2D (2-dimensional) array that can be used to store & work with spreadsheet-like data. They can be used for: Representing a board in a table game (chess, checkers, etc.) Sta… Read More
2018-12-07 18:13
REPL stands for Read-Eval-Print-Loop. It’s a program that allows you to type Ruby code & see the result directly. This is useful because you can quickly test how something works. F… Read More
2018-12-03 15:00
Imagine a traffic light… It can be red, green or yellow. When it changes colors, the next color is based on the current one. Let’s say that this is the kind that makes a sound f… Read More
2018-12-01 11:51
If you want to run an external command from Ruby… …like wkhtmltopdf to convert an HTML file into a PDF. There are a few Ruby methods you can use. Depending on the method you us… Read More
2018-11-26 15:05
What is a heredoc? A heredoc is a way to define a multi-line string, while maintaining the original indentation & formatting. This is used to embed snippets of code, like SQL or HTML. He… Read More
2018-11-16 14:50
You can give an alternative name to a Ruby method in two ways: alias (keyword) alias_method Because they do the same thing in slightly different ways this can be a confusing topic. Let&rsquo&hell…Read More
2018-11-11 16:58
A new version of Ruby is coming with new features & performance improvements. Would you like to keep up with the changes? Let’s have a look! Endless Ranges Ruby 2.5 & older ver… Read More
2018-11-07 14:15
ERB is a templating engine. A templating engine allows you to mix HTML & Ruby. This helps you generate your page dynamically using data from your database. ERB is Rails default engine fo… Read More
2018-10-23 20:38
CSV stands for “Comma-Separated Values”. It’s a common format for exporting & importing data. For example: You can export your Gmail contacts as a CSV file, and you can… Read More
2018-10-20 13:41
Today you’ll learn about 4 Enumerable methods that will help you check a conditional statement against an array of elements, a hash, or any other objects that include the Enumerable mo… Read More
2018-10-14 16:17
Ruby on Rails is an open-source web application framework. A framework is a collection of code, tools & utilities that give you a specific structure to work with. This structure makes yo… Read More
2018-10-10 12:01
Map is a Ruby method that you can use with Arrays, Hashes & Ranges. The main use for map is to TRANSFORM data. For example: Given an array of strings, you could go over every string &amp&hell…Read More
2018-10-08 13:50
What does public, private & protected mean in Ruby? These 3 methods control the public interface of your class. They control WHO can call these methods. By default all your methods are p… Read More
2018-10-02 19:27
In Object-Oriented Programming, there are two ways for classes to work together. They are: Inheritance Composition With inheritance, you create class hierarchies, where a parent class shares… Read More
2018-09-18 14:00
If you would like to use string methods (like gsub) but you’re working with an integer… What can you do? Use a conversion method! For example: You can convert the Integer 1 to t… Read More
2018-09-11 13:19
What does the super keyword do in Ruby? It calls a method on the parent class with the same name as the method that calls super. For example: If you call a method named i_like_chocolate, and… Read More
2018-09-04 15:30
Would you like to know what goes on behind the scenes of Rails, Sinatra, and other Ruby web frameworks? Then you’re in the right place. Because today we are going to talk about Rack! R… Read More
2018-08-22 14:53
N-Queens is an interesting coding challenge where you have to place N queens on a N * N board. It looks like this: A queen can move in all directions: Vertical Horizontal Diagonal The soluti… Read More
2018-06-13 13:59
Following my last article, why do we use nil, I thought it’d be a good idea to ask this question for other things that we take for granted. Like… Why do we use classes instead o… Read More
2018-05-30 14:09
I was having a chat with a friend about a piece of Ruby code & the topic of return values came up… …and of course, nil is always part of that conversation. Later that day… Read More
2018-04-30 19:39
The decorator design pattern… What is it, and how can you use this pattern in your Ruby projects? The decorator design pattern helps you enhance an object by adding new capabilities t… Read More

Share the post

Black Bytes

×

Subscribe to Black Bytes

Get updates delivered right to your inbox!

Thank you for your subscription

×