Sha256: 980efa354ac2342f16c21108d883c64bb588e4a662611a33736e1ef3cc8db244

Contents?: true

Size: 199 Bytes

Versions: 13

Compression:

Stored size: 199 Bytes

Contents

# frozen_string_literal: true

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

      s
    end
    st.new(*maps)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
awspec-1.31.0 lib/awspec/ext/hash.rb
awspec-1.30.0 lib/awspec/ext/hash.rb
awspec-1.29.3 lib/awspec/ext/hash.rb
awspec-1.29.2 lib/awspec/ext/hash.rb
awspec-1.29.1 lib/awspec/ext/hash.rb
awspec-1.29.0 lib/awspec/ext/hash.rb
awspec-1.28.2 lib/awspec/ext/hash.rb
awspec-1.28.1 lib/awspec/ext/hash.rb
awspec-1.28.0 lib/awspec/ext/hash.rb
awspec-1.27.1 lib/awspec/ext/hash.rb
awspec-1.27.0 lib/awspec/ext/hash.rb
awspec-1.26.0 lib/awspec/ext/hash.rb
awspec-1.25.2 lib/awspec/ext/hash.rb