A collection of Ruby classes and mixins that extend Hashes with powerful features like method access, coercion, and indifferent access.
Hashie is a Ruby library that enhances the standard Hash class with a collection of extensions and subclasses. It solves the problem of rigid hash manipulation by adding features like method-style access, automatic type coercion, and deep nested operations, making hashes behave more like flexible objects.
Ruby developers working with complex hash data, such as API clients, configuration management, or data transformation layers, who need more expressive and less verbose hash handling.
Developers choose Hashie because it provides a modular, mixin-based approach to extending hashes without monkey-patching, offering a wide range of utilities like Dash for structured data and Mash for pseudo-objects, all while staying lightweight and interoperable with existing Ruby code.
Hashie is a collection of classes and mixins that make Ruby hashes more powerful.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Enables dot notation and query methods (e.g., hash.name?) for hash values, making code more readable and object-like without sacrificing hash functionality.
Allows mixing in only needed modules like Coercion or IndifferentAccess, providing a lightweight and composable way to enhance hashes without monkey-patching.
Offers deep_merge, deep_fetch, and deep_locate for easy manipulation and retrieval in complex nested hashes, useful for API responses or configuration data.
Dash subclass enforces defined properties with defaults, required fields, and custom validations, ideal for creating strict data models from external sources.
Logs noisy warnings when keys conflict with existing methods (e.g., overriding 'zip'), requiring explicit disabling via disable_warnings or quiet mode.
Dynamic features like method_missing and PermissiveRespondTo add runtime cost—up to 20% slower initialization and setters—and can cause memory growth.
Handles non-symbolizable keys (e.g., numbers) inconsistently, and circular coercions require procedural workarounds, increasing setup complexity.