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-1.5.2-java lib/pacer/core/hash_route.rb
pacer-1.5.1-java lib/pacer/core/hash_route.rb
pacer-1.4.2-java lib/pacer/core/hash_route.rb
pacer-1.4.1-java lib/pacer/core/hash_route.rb
pacer-1.4.0-java lib/pacer/core/hash_route.rb
pacer-1.3.5-java lib/pacer/core/hash_route.rb
pacer-1.3.4-java lib/pacer/core/hash_route.rb
pacer-1.3.3-java lib/pacer/core/hash_route.rb
pacer-1.3.2-java lib/pacer/core/hash_route.rb
pacer-1.3.1-java lib/pacer/core/hash_route.rb
pacer-1.2.0-java lib/pacer/core/hash_route.rb