Ruby

Write reliable Ruby avoiding mutable string traps, block pitfalls, and metaprogramming bugs.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "Ruby" with this command: npx skills add ivangdavila/ruby

Quick Reference

TopicFile
Mutable strings, object equalityobjects.md
Proc vs lambda, return behaviorblocks.md
Visibility, method_missingmethods.md
Array/hash mutation trapscollections.md
define_method, eval trapsmetaprogramming.md
ActiveRecord, N+1, callbacksrails.md

Critical Rules

  • Strings are mutable — s = "hi"; s << "!"; t = s means t also has "!"
  • == vs equal? vs eql?== value, equal? identity, eql? hash equality
  • Default hash value is shared — Hash.new([]) shares same array, use block form
  • return in proc returns from enclosing method — use lambda for local return
  • Block variable shadows outer scope — x = 1; [2].each { |x| }; x is still 1 (3.0+)
  • method_missing without respond_to_missing? — breaks respond_to? checks
  • private in Ruby is per-object — self.private_method fails, implicit receiver works
  • ||= doesn't work for false/nil distinction — false ||= true replaces false
  • Frozen string literals — # frozen_string_literal: true makes strings immutable
  • Symbol#to_proc&:method_name only works with no-argument methods
  • rescue => e without type — catches StandardError, not Exception
  • ensure always runs — even after return, use for cleanup

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

Power Automate Debug

Debug failing Power Automate cloud flows using the FlowStudio MCP server. The Graph API only shows top-level status codes. This skill gives your agent action...

Registry SourceRecently Updated
Coding

Power Automate Mcp

Foundation skill for Power Automate via FlowStudio MCP — auth setup, the reusable MCP helper (Python + Node.js), tool discovery via `list_skills` / `tool_sea...

Registry SourceRecently Updated
Coding

data-analyst

Expert data analyst specializing in business intelligence, data visualization, and statistical analysis. Masters SQL, Python, and BI tools to transform raw d...

Registry SourceRecently Updated
Coding

DeviantArt Post

Post artwork, journals, and status updates to a user's DeviantArt account through the official DeviantArt API using OAuth 2.1 Authorization Code with PKCE, S...

Registry SourceRecently Updated