Module: Dry::Struct::Hashify
- Defined in:
- lib/dry/struct/hashify.rb
Class Method Summary collapse
Class Method Details
.[](value) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/dry/struct/hashify.rb', line 6 def self.[](value) if value.respond_to?(:to_hash) value.to_hash elsif value.respond_to?(:map) value.map { |item| self[item] } else value end end |