Class: Struct
- Inherits:
-
Object
- Object
- Struct
- Includes:
- Everythingrb::InspectQuotable
- Defined in:
- lib/everythingrb/struct.rb
Overview
Extensions to Ruby’s core Struct class
Provides:
-
#to_deep_h: Recursively convert to hash with all nested objects
-
#in_quotes, #with_quotes: Wrap struct in quotes
Instance Method Summary collapse
-
#to_deep_h ⇒ Hash
Recursively converts the Struct and all nested objects to hashes.
Methods included from Everythingrb::InspectQuotable
Instance Method Details
#to_deep_h ⇒ Hash
Recursively converts the Struct and all nested objects to hashes
This method traverses the entire Struct structure, converting not just the top-level Struct but also nested Structs, OpenStructs, Data objects, and any other objects that implement ‘to_h`.
35 36 37 |
# File 'lib/everythingrb/struct.rb', line 35 def to_deep_h to_h.to_deep_h end |