Results for: "match"

An ObjectSpace::WeakKeyMap is a key-value map that holds weak references to its keys, so they can be garbage collected when there is no more references.

Unlike ObjectSpace::WeakMap:

(Note that GC.start is used here only for demonstrational purposes and might not always lead to demonstrated results.)

The collection is especially useful for implementing caches of lightweight value objects, so that only one copy of each value representation would be stored in memory, but the copies that aren’t used would be garbage-collected.

CACHE = ObjectSpace::WeakKeyMap

def make_value(**)
   val = ValueObject.new(**)
   if (existing = @cache.getkey(val))
      # if the object with this value exists, we return it
      existing
   else
      # otherwise, put it in the cache
      @cache[val] = true
      val
   end
end

This will result in make_value returning the same object for same set of attributes always, but the values that aren’t needed anymore woudn’t be sitting in the cache forever.

No documentation available
No documentation available

Flags for interpolated string nodes that indicated mutability if they are also marked as literals.

This module is responsible for converting the prism syntax tree into other syntax trees.

Commands will be placed in this namespace

No documentation available
No documentation available

Mixin methods for commands that work with gemspecs.

Mixin methods for install and update options for Gem::Commands

This module is used for safely loading Marshal specs from a gem. The ‘safe_load` method defined on this module is specifically designed for loading Gem specifications.

Mixin methods for Gem::Command to promote available RubyGems update

No documentation available

The result of parsing a pack template.

No documentation available
No documentation available
No documentation available
No documentation available

Searches for gems starting with the supplied argument.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
Search took: 5ms  ·  Total Results: 2599