# dry-struct

> Typed structs and value objects for Ruby

Source: https://talira.ai/catalog/dry-struct-bmgh1sgh
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / validation / values](https://talira.ai/categories/libraries/validation/values), [languages / ruby](https://talira.ai/categories/languages/ruby)
- Licence: MIT[^1][^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [dry-rb](https://talira.ai/orgs/dry-rb.md)

dry-struct defines typed struct classes in Ruby with a Virtus-like DSL, built on dry-types: each attribute has a type that coerces and checks its value (for example an optional String, or a coercible Integer that turns "21" into 21), and structs are meant to be immutable. It's part of the dry-rb collection of Ruby libraries.

## Links

- Website: https://dry-rb.org/gems/dry-struct
- GitHub: https://github.com/dry-rb/dry-struct
- Docs: https://dry-rb.org/gems/dry-struct

## Problems it solves

- define typed value objects in Ruby
- coerce and validate attributes of a Ruby struct
- a Virtus-like typed attribute DSL for Ruby

## Features

- typed struct classes with an attribute DSL
- type coercion and constraints via dry-types
- immutable structs

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.63, adoption 0.53, momentum 0.20, community 0.65, backing 0.30, extensibility 0.00.

- last commit 7 days ago
- 5 commits in the last 90 days
- latest release v1.8.1 9 months ago
- 445 GitHub stars
- 40 contributors
- accepts sponsorship (Github)
- backed by dry-rb

## Sources

[^1]: https://github.com/dry-rb/dry-struct/blob/main/LICENSE (checked 29 Nov 2026)
[^2]: https://github.com/dry-rb/dry-struct/blob/main/dry-struct.gemspec (checked 29 Nov 2026)
