Sha256: 72e9ecdbe1d73ec1066e465c55aee33c76d3ce45a2b4babe0bae9178f3b47257

Contents?: true

Size: 274 Bytes

Versions: 39

Compression:

Stored size: 274 Bytes

Contents

# frozen_string_literal = true

RSpec.describe :index_by do
  link :index_by, from: :ree_array

  it {
    list = [ {id: 1}, {id: 2} ]
    result = index_by(list) { _1[:id] }

    expect(result).to eq(
      {
        1 => {id: 1},
        2 => {id: 2}
      }
    )
  }
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
ree_lib-1.0.39 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.38 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.37 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.36 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.35 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.34 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.33 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.32 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.31 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.30 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.29 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.28 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.27 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.26 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.24 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.23 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.22 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.21 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.20 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb
ree_lib-1.0.19 lib/ree_lib/packages/ree_array/spec/ree_array/functions/index_by_spec.rb