Sha256: 049dad5c2c6b533bc4b1989a6d6090285a7b01669b86ef9782f0513bdd87da64

Contents?: true

Size: 516 Bytes

Versions: 16

Compression:

Stored size: 516 Bytes

Contents

class ::Hash
  # via https://stackoverflow.com/a/25835016/2257038
  def stringify_keys
    h = self.map do |k, v|
      v_str = if v.instance_of? Hash
          v.stringify_keys
        else
          v
        end

      [k.to_s, v_str]
    end
    Hash[h]
  end

  # via https://stackoverflow.com/a/25835016/2257038
  def symbol_keys
    h = self.map do |k, v|
      v_sym = if v.instance_of? Hash
          v.symbol_keys
        else
          v
        end

      [k.to_sym, v_sym]
    end
    Hash[h]
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
livekit-server-sdk-0.6.3 lib/livekit/utils.rb
livekit-server-sdk-0.6.2 lib/livekit/utils.rb
livekit-server-sdk-0.6.1 lib/livekit/utils.rb
livekit-server-sdk-0.5.6 lib/livekit/utils.rb
livekit-server-sdk-0.5.5 lib/livekit/utils.rb
livekit-server-sdk-0.5.4 lib/livekit/utils.rb
livekit-server-sdk-0.5.3 lib/livekit/utils.rb
livekit-server-sdk-0.5.2 lib/livekit/utils.rb
livekit-server-sdk-0.5.1 lib/livekit/utils.rb
livekit-server-sdk-0.5.0 lib/livekit/utils.rb
livekit-server-sdk-0.4.0 lib/livekit/utils.rb
livekit-server-sdk-0.3.1 lib/livekit/utils.rb
livekit-server-sdk-0.3.0 lib/livekit/utils.rb
livekit-server-sdk-0.2.2 lib/livekit/utils.rb
livekit-server-sdk-0.2.1 lib/livekit/utils.rb
livekit-server-sdk-0.2.0 lib/livekit/utils.rb