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-0.79.1 lib/awspec/ext/hash.rb
awspec-0.79.0 lib/awspec/ext/hash.rb
awspec-0.78.1 lib/awspec/ext/hash.rb
awspec-0.77.1 lib/awspec/ext/hash.rb
awspec-0.77.0 lib/awspec/ext/hash.rb
awspec-0.76.1 lib/awspec/ext/hash.rb
awspec-0.76.0 lib/awspec/ext/hash.rb
awspec-0.75.2 lib/awspec/ext/hash.rb
awspec-0.75.1 lib/awspec/ext/hash.rb
awspec-0.75.0 lib/awspec/ext/hash.rb
awspec-0.74.1 lib/awspec/ext/hash.rb
awspec-0.74.0 lib/awspec/ext/hash.rb
awspec-0.73.2 lib/awspec/ext/hash.rb
awspec-0.73.1 lib/awspec/ext/hash.rb
awspec-0.73.0 lib/awspec/ext/hash.rb
awspec-0.72.0 lib/awspec/ext/hash.rb
awspec-0.71.0 lib/awspec/ext/hash.rb
awspec-0.70.0 lib/awspec/ext/hash.rb