SafeOstruct is a lightweight, dependency-free struct-like class backed by a plain symbol-keyed Hash. It supports dynamic attribute definition via keyword arguments, method-style and hash-style (symbol or string) access, and returns nil instead of raising NoMethodError for undefined attributes. Unlike OpenStruct, it never defines singleton methods, so instantiation stays fast and method caches stay intact.

Required Ruby Version

>= 3.0

Authors

Waqas Ali

Versions

  1. 2.0.0 July 27, 2026 (11 KB)
  2. 1.0.0 July 27, 2026 (8.5 KB)

Pushed by

SHA 256 checksum