Black Bytes » ruby http://www.blackbytes.info Ruby Programming Tutorials Tue, 15 Mar 2016 15:43:05 +0000 en-US hourly 1 http://wordpress.org/?v=4.3.3 Exploring MRI Source Code http://www.blackbytes.info/2016/02/exploring-mri/ http://www.blackbytes.info/2016/02/exploring-mri/#comments Tue, 16 Feb 2016 21:39:56 +0000 http://www.blackbytes.info/?p=2604 If you have been using Ruby for a while you are probably curious about how some things work under the hood. One way to dig deep into Ruby internals is by reading the source code that makes it work. Even if you don’t know C, you can still pick up some interesting things. A great […]

The post Exploring MRI Source Code appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/02/exploring-mri/feed/ 5
The Ultimate Guide to Blocks, Procs & Lambdas http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/ http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comments Tue, 02 Feb 2016 18:26:17 +0000 http://www.blackbytes.info/?p=2561 Understanding Blocks Blocks are very prevalent in Ruby, you can think of them as little anonymous functions that can be passed into methods. Blocks are enclosed in a do / end statement or between brackets {}, and they can have multiple arguments. The argument names are defined between two pipe | characters. If you have […]

The post The Ultimate Guide to Blocks, Procs & Lambdas appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/feed/ 11
11 Ruby Tricks You Haven’t Seen Before http://www.blackbytes.info/2016/01/ruby-tricks/ http://www.blackbytes.info/2016/01/ruby-tricks/#comments Mon, 18 Jan 2016 20:40:35 +0000 http://www.blackbytes.info/?p=2491 1. Deep copy When you copy an object that contains other objects, like an Array, only a reference to these objects is copied. You can see that in action here: [crayon-56ed27b112540190318700/] Using the Marshal class, which is normally used for serialization, you can create a ‘deep copy’ of an object. [crayon-56ed27b112556867026205/] The results: [crayon-56ed27b112560981147538/] 2. […]

The post 11 Ruby Tricks You Haven’t Seen Before appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2016/01/ruby-tricks/feed/ 20
Ruby Time & Date Classes http://www.blackbytes.info/2015/12/ruby-time/ http://www.blackbytes.info/2015/12/ruby-time/#comments Tue, 15 Dec 2015 20:00:57 +0000 http://www.blackbytes.info/?p=2355 If you want to do anything related with time you probably want to use some sort of class that can store and work with this type of data. In this article you will learn what time-related classes and methods are available in Ruby and how to use them. The Time Class To manage time in […]

The post Ruby Time & Date Classes appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/12/ruby-time/feed/ 2
Introduction to Refactoring http://www.blackbytes.info/2015/12/ruby-refactoring/ http://www.blackbytes.info/2015/12/ruby-refactoring/#comments Tue, 01 Dec 2015 18:47:59 +0000 http://www.blackbytes.info/?p=2335 If you aren’t familiar with the term, refactoring is the act of improving the quality of code without changing what it does. This will make your code a lot easier to work with. In this post you will learn some common refactoring techniques, let’s get started! Extract Method One of the most common refactorings is […]

The post Introduction to Refactoring appeared first on Black Bytes.

]]>
http://www.blackbytes.info/2015/12/ruby-refactoring/feed/ 0