Sha256: 0c79436a3cca76a30d5c878a0fe2e3a86ca5e5fe85c5d6ac5af5e22fb0a12258

Contents?: true

Size: 579 Bytes

Versions: 31

Compression:

Stored size: 579 Bytes

Contents

module Pacer
  module Core
    module HashRoute
      def lengths
        map(element_type: :integer) { |h| h.length }
      end

      def keys
        map(element_type: :array) { |h| h.keys }
      end

      def values
        map(element_type: :array) { |h| h.values }
      end

      def pairs
        map(element_type: :array) { |h| h.to_a }
      end

      def [](k)
        map { |h| h[k] }
      end

      def set(k, v)
        process { |h| h[k] = v }
      end

      def fetch(k, *d, &block)
        map { |h| h.fetch(k, *d, &block) }
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/core/hash_route.rb
pacer-2.0.22-java lib/pacer/core/hash_route.rb
pacer-2.0.20-java lib/pacer/core/hash_route.rb
pacer-2.0.19-java lib/pacer/core/hash_route.rb
pacer-2.0.18-java lib/pacer/core/hash_route.rb
pacer-2.0.17-java lib/pacer/core/hash_route.rb
pacer-2.0.16-java lib/pacer/core/hash_route.rb
pacer-2.0.15-java lib/pacer/core/hash_route.rb
pacer-2.0.14-java lib/pacer/core/hash_route.rb
pacer-2.0.13-java lib/pacer/core/hash_route.rb
pacer-2.0.12-java lib/pacer/core/hash_route.rb
pacer-2.0.10-java lib/pacer/core/hash_route.rb
pacer-2.0.10.pre-java lib/pacer/core/hash_route.rb
pacer-2.0.8-java lib/pacer/core/hash_route.rb
pacer-2.0.6-java lib/pacer/core/hash_route.rb
pacer-2.0.4.pre-java lib/pacer/core/hash_route.rb
pacer-2.0.0.pre-java lib/pacer/core/hash_route.rb
pacer-1.6.0-java lib/pacer/core/hash_route.rb
pacer-1.5.4-java lib/pacer/core/hash_route.rb
pacer-1.5.3-java lib/pacer/core/hash_route.rb