Sha256: 982a14a1dde0501b4591a81193c25287a92bc5bc7f9a2ea9e69007cee5373376

Contents?: true

Size: 247 Bytes

Versions: 23

Compression:

Stored size: 247 Bytes

Contents

class Hash
  def dig(key, *keys)
    value = self[key]
    if !value.nil? && !keys.empty?
      value.dig(*keys)
    else
      value
    end
  end

  def to_struct
    OpenStruct.new self
  end

  def amend(other)
    other.merge(self)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
mumukit-core-1.6.0 lib/mumukit/core/hash.rb
mumukit-core-1.5.2 lib/mumukit/core/hash.rb
mumukit-core-1.5.1 lib/mumukit/core/hash.rb
mumukit-core-1.5.0 lib/mumukit/core/hash.rb
mumukit-core-1.4.0 lib/mumukit/core/hash.rb
mumukit-core-1.3.0 lib/mumukit/core/hash.rb
mumukit-core-1.2.2 lib/mumukit/core/hash.rb
mumukit-core-1.2.1 lib/mumukit/core/hash.rb
mumukit-core-1.2.0 lib/mumukit/core/hash.rb
mumukit-core-1.1.0 lib/mumukit/core/hash.rb
mumukit-core-1.0.1 lib/mumukit/core/hash.rb
mumukit-core-1.0.0 lib/mumukit/core/hash.rb
mumukit-core-0.6.0 lib/mumukit/core/hash.rb
mumukit-core-0.5.0 lib/mumukit/core/hash.rb
mumukit-core-0.4.3 lib/mumukit/core/hash.rb
mumukit-core-0.4.2 lib/mumukit/core/hash.rb
mumukit-core-0.4.1 lib/mumukit/core/hash.rb
mumukit-core-0.4.0 lib/mumukit/core/hash.rb
mumukit-core-0.3.0 lib/mumukit/core/hash.rb
mumukit-core-0.2.0 lib/mumukit/core/hash.rb