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
cthiesfork-awspec-1.2.2 lib/awspec/ext/hash.rb
cthiesfork-awspec-1.2.1 lib/awspec/ext/hash.rb
awspec-1.18.5 lib/awspec/ext/hash.rb
cthiesfork-awspec-1.2.0 lib/awspec/ext/hash.rb
cthiesfork-awspec-1.1.0 lib/awspec/ext/hash.rb
cthiesfork-awspec-1.0.0 lib/awspec/ext/hash.rb
awspec-1.18.4 lib/awspec/ext/hash.rb
awspec-1.18.3 lib/awspec/ext/hash.rb
awspec-1.18.2 lib/awspec/ext/hash.rb
awspec-1.18.1 lib/awspec/ext/hash.rb
awspec-1.18.0 lib/awspec/ext/hash.rb
awspec-1.17.4 lib/awspec/ext/hash.rb
awspec-1.17.3 lib/awspec/ext/hash.rb
awspec-1.17.2 lib/awspec/ext/hash.rb
awspec-1.17.1 lib/awspec/ext/hash.rb
awspec-1.17.0 lib/awspec/ext/hash.rb
awspec-1.16.1 lib/awspec/ext/hash.rb
awspec-1.16.0 lib/awspec/ext/hash.rb
awspec-1.15.3 lib/awspec/ext/hash.rb
awspec-1.15.2 lib/awspec/ext/hash.rb