Sha256: 74ffed8d5355e02c879f96c9d00bc98b3a66752e111980de3c140c809649f9a5

Contents?: true

Size: 177 Bytes

Versions: 118

Compression:

Stored size: 177 Bytes

Contents

class Hash
  def to_struct
    st = Struct.new(*self.keys)
    maps = self.values.map do |s|
      next s.to_struct if s.is_a?(Hash)
      s
    end
    st.new(*maps)
  end
end

Version data entries

118 entries across 118 versions & 4 rubygems

Version Path
awspec-1.15.1 lib/awspec/ext/hash.rb
awspec-1.15.0 lib/awspec/ext/hash.rb
awspec-1.14.1 lib/awspec/ext/hash.rb
awspec-1.14.0 lib/awspec/ext/hash.rb
awspec-1.13.0 lib/awspec/ext/hash.rb
awspec-1.12.7 lib/awspec/ext/hash.rb
awspec-1.12.6 lib/awspec/ext/hash.rb
awspec-1.12.5 lib/awspec/ext/hash.rb
awspec-1.12.4 lib/awspec/ext/hash.rb
awspec-1.12.3 lib/awspec/ext/hash.rb
awspec-1.12.2 lib/awspec/ext/hash.rb
awspec-1.12.1 lib/awspec/ext/hash.rb
awspec-1.12.0 lib/awspec/ext/hash.rb
awspec-1.11.1 lib/awspec/ext/hash.rb
awspec-1.11.0 lib/awspec/ext/hash.rb
awspec-1.10.0 lib/awspec/ext/hash.rb
awspec-1.9.0 lib/awspec/ext/hash.rb
awspec-1.8.0 lib/awspec/ext/hash.rb
awspec-1.7.0 lib/awspec/ext/hash.rb
awspec-1.6.1 lib/awspec/ext/hash.rb