Guides to the core and standard libraries, as well as selected Rubygems.
Category: APIs and Libraries
Episode #059: Enumerator
In previous episodes we've touched on Enumerator in passing. This time it'll take center stage, as we explore just what an Enumerator is and what it's good for.
Episode #047: FFI Part 2: Smoke Test One
In part 2 of this series, we buy ourselves some peace of mind with a simple smoke test. The code for this episode can be found here: https://github.com/avdi/pulse-ffi/tree/RubyTapas047
Episode #045: Hash Default Value
This cautionary episode demonstrates and explains a Hash gotcha that often comes as a surprise.
Episode #044: #one?
Somtetimes you need to know if exactly one element in a collection has a given property. For that situation, we have the #one? predicate method.
Episode #041: String#scan
Today's episode looks at a convenient tool for weeding through text and pulling out parts that match a given pattern.
Episode #034: Struct from Hash
For such similar and broadly useful data structures, Struct and Hash are surprisingly incompatible. In this episode we look at some ways to smooth over their differences, and answer a …
Episode #032: Hash Default Blocks
Following on to the episodes about #fetch, today's episode answers the question: what do we do when we want the same defaulting behavior everwhere a Hash is used?
Episode #025: OpenStruct
This episode focuses on OpenStruct, which makes it easy to create ad-hoc value objects from hashes.
Episode #023: Tempfile
In this episode we look at the Tempfile standard library, and how it can facilitate communicating with subprocesses.