March 26, 2015 by Daniel P. Clark

Different Collection Types in Ruby

In computer science, a collection or container is a grouping of some variable number of data items (possibly zero) that have some shared significance to the problem being solved and need to be operated upon together in some controlled fashion. – Wikipedia In Ruby the most common collection types used are known as Array and…

Continue Reading »

February 4, 2015 by Daniel P. Clark

Using Ruby Object Type Classes to Safely Build Data

When building collections of data you will find situations where the types aren’t what you planned to work with.  And when I say types I’m speaking generically of arrays, hashes, strings, integers, nil, etc.  Everything’s cosy when you know what your getting.  For example putting 10 integers into an Array: arr = [] 10.times do…

Continue Reading »