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.25.1 lib/awspec/ext/hash.rb
awspec-1.25.0 lib/awspec/ext/hash.rb
awspec-1.24.4 lib/awspec/ext/hash.rb
awspec-1.24.3 lib/awspec/ext/hash.rb
awspec-1.24.2 lib/awspec/ext/hash.rb
awspec-1.24.1 lib/awspec/ext/hash.rb
awspec-1.24.0 lib/awspec/ext/hash.rb
awspec-1.23.0 lib/awspec/ext/hash.rb
awspec-1.22.1 lib/awspec/ext/hash.rb
awspec-1.22.0 lib/awspec/ext/hash.rb
awspec-1.21.1 lib/awspec/ext/hash.rb
awspec-1.21.0 lib/awspec/ext/hash.rb
awspec-1.20.0 lib/awspec/ext/hash.rb
awspec-1.19.2 lib/awspec/ext/hash.rb
awspec-1.19.1 lib/awspec/ext/hash.rb
awspec-1.19.0 lib/awspec/ext/hash.rb
cthiesfork-awspec-1.2.4 lib/awspec/ext/hash.rb
awspec-api_gateway_extended-1.2.4 lib/awspec/ext/hash.rb
awspec-api_gateway_extended-1.2.3 lib/awspec/ext/hash.rb
awspec-1.18.6 lib/awspec/ext/hash.rb