Sha256: f5b84192c9f5363a0ba309373e2636355f570acfa4c7d9d9db7c8b5a7d74fb28

Contents?: true

Size: 211 Bytes

Versions: 2

Compression:

Stored size: 211 Bytes

Contents

# frozen_string_literal: true

# Monkeypatch OpensSTruct for transofrm into hashes
class OpenStruct
  def deep_to_h
    to_h.transform_values do |v|
      v.is_a?(OpenStruct) ? v.deep_to_h : v
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rspec-qbec-0.0.3 lib/rspec/qbec/openstruct.rb
rspec-qbec-0.0.2 lib/rspec/qbec/openstruct.rb