Sha256: 082d1f7a2ec9f9cab01f3bfad9cfe9c4757ecc2964898c8f8cb9babae9a920ed

Contents?: true

Size: 722 Bytes

Versions: 62

Compression:

Stored size: 722 Bytes

Contents

# HoboSupport - Methodphitamine

    doctest_require: '../../lib/hobo_support'
{.hidden}

## `Kernel#it` and `Kernel#its`

A nice hack from Jay Phillips, christened "Methodphitamine". The low-down is in the [original blog post][1].

[1]: http://jicksta.com/articles/2007/08/04/the-methodphitamine

    >> (1..10).select &it % 2 == 0
    => [2, 4, 6, 8, 10]
    >> %w(a few short words).map &its.length
    => [1, 3, 5, 5]

Note that `it` and `its` are identical. They just read better in different contexts. Note that methodphitamine is also released directly by Jay (simply `gem install methodphitamine`) but it's small enough that it seemed easier to add it to HoboSupport and avoid an extra dependency. Thanks to Jay.

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
hobo_support-2.2.6 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.5 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.4 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.3 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.2 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.1 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.2.0 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.2 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.1 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.0 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.0.pre4 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.0.pre3 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.0.pre2 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.1.0.pre1 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.0.1 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.0.0 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.0.0.pre10 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.0.0.pre9 test/hobosupport/methodphitamine.rdoctest
hobo_support-2.0.0.pre8 test/hobosupport/methodphitamine.rdoctest
hobo_support-1.3.3 test/hobosupport/methodphitamine.rdoctest