Sha256: 7b824cb89a808636c2353a8d559f160a2651a68fe01d0ec76bac1762b5730cc8

Contents?: true

Size: 928 Bytes

Versions: 15

Compression:

Stored size: 928 Bytes

Contents

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
# 
# http://www.apache.org/licenses/LICENSE-2.0
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

module Enumerable
  def collect_hash
    inject(Hash.new) do |memo, i|
      k, v = yield(i)
      memo[k] = v if k
      memo
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
avro-1.7.6 lib/avro/collect_hash.rb
avro-jruby-1.7.5 lib/avro/collect_hash.rb
avro-1.7.5 lib/avro/collect_hash.rb
avro-1.7.4 lib/avro/collect_hash.rb
avro-1.7.3 lib/avro/collect_hash.rb
avro-1.7.2 lib/avro/collect_hash.rb
avro-1.7.1 lib/avro/collect_hash.rb
avro-1.7.0 lib/avro/collect_hash.rb
avro-1.6.3 lib/avro/collect_hash.rb
avro-1.6.2 lib/avro/collect_hash.rb
avro-1.6.1 lib/avro/collect_hash.rb
avro-1.6.0 lib/avro/collect_hash.rb
avro-1.5.4 lib/avro/collect_hash.rb
avro-1.3.3 lib/avro/collect_hash.rb
avro-1.3.0 lib/avro/collect_hash.rb