0.0
Low commit activity in last 3 years
No release in over a year
short forms of common idioms, extensions to remove most blocks, commonly used helpers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

Runtime

 Project Readme

Lab42Console

Build Status Gem Version Code Climate Issue Count Test Coverage

Intrusive Ruby Tools for the Console Only

Applying operations to collections

By using by we create what one could call a compaignon collection which can be transformed, at the end we can use finders and filters on these compagnon collection to access the original data

Let us for example suppose that we have the following data

    let(:data) {
      (0..9).map{ |n|
        OpenStruct.new(id: n, name: "name #{n}", content: (0..n).map{ |k| "data #{k}" })
      }
    }

Now we can filter the original data by selecting on some transformations on the compagnon collection, firstly we create a compagnon collection which contains only the names:

  let(:compagnon){ data.by(:name) }

Now we can access the original for example as follows

    expect(compagnon.fnd("name 1")).to eq(data[1])

We can chain by as much as we want

    let(:children_count) { data.by(:content).by(:size) }

And select on children count

    expect(children_count.sel(:>, 8)).to eq(data[8..9])

Author

Copyright © 2019,20 Robert Dober mailto: robert.dober@gmail.com

LICENSE

Same as Elixir -- ;) --, which is Apache License v2.0. Please refer to LICENSE for details.

SPDX-License-Identifier: Apache-2.0