Skip to content
Back to skills

Ruby Idioms

ASecurity

Reference for idiomatic Ruby standard-library usage — Enumerable patterns, blocks/procs/lambdas, hash/array/Set/Range idioms, File/IO, freeze patterns, Comparable/Enumerable mixins, and stdlib logging. CONSULT when writing or reviewing Ruby and unsure which stdlib tool or idiom fits — choosing between map / each_with_object / filter_map / tally, Set vs Array, block vs lambda vs proc, dig/fetch, ranges, execute-around, or frozen-string patterns. This is reference knowledge loaded on demand, no...

  • 2 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
ai-agentsruby

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned September 24, 2026

npx -y skills add mik2win/foureyes --skill ruby-idioms --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ruby Idioms?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ruby Idioms
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mik2win-ruby-idioms/badge)](https://www.skillsdirectory.com/skills/mik2win-ruby-idioms)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ruby-idioms
description: >-
  Reference for idiomatic Ruby standard-library usage — Enumerable patterns,
  blocks/procs/lambdas, hash/array/Set/Range idioms, File/IO, freeze patterns,
  Comparable/Enumerable mixins, and stdlib logging.
  CONSULT when writing or reviewing Ruby and unsure which stdlib tool or idiom fits —
  choosing between map / each_with_object / filter_map / tally, Set vs Array, block vs
  lambda vs proc, dig/fetch, ranges, execute-around, or frozen-string patterns. This is
  reference knowledge loaded on demand, not an always-on rule.
allowed-tools:
  - Read
  - Grep
  - Glob
---

# Ruby standard library and functional idioms

Based on Ruby docs.
Read the reference file (in this skill's folder) for the topic you need:

- **Enumerable** — core trio, each_with_object, flat_map/filter_map/tally, group_by/chunk,
  lookups, including Enumerable in your own classes → `references/enumerable.md`
- **Blocks, procs, lambdas** — when to use what, execute-around, yielding with args →
  `references/blocks-procs.md`
- **Hash / Array / Set** — symbol vs string keys, dig/fetch, slice/except/merge, Set for
  O(1) membership, each_cons/each_slice, readable predicates → `references/hash-array-set.md`
- **Ranges** — iteration, case matching, slicing, membership, `cover?` → `references/ranges.md`
- **File and IO** — block form, read strategies, path building → `references/file-io.md`
- **Freeze patterns** — `frozen_string_literal`, chilled strings, frozen constants →
  `references/freeze.md`
- **Comparable / Enumerable mixins** — define `<=>`/`each` in your own classes →
  `references/comparable-enumerable.md`
- **Structured logging** — stdlib Logger via DI, level discipline, never log secrets →
  `references/logging.md`

Files in this skill

  • SKILL.md1.8 KB
  • references/blocks-procs.md2.2 KB
  • references/comparable-enumerable.md715 B
  • references/enumerable.md2.9 KB
  • references/file-io.md1.1 KB
  • references/freeze.md1.2 KB
  • references/hash-array-set.md2.5 KB
  • references/logging.md1.6 KB
  • references/ranges.md762 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.