Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rkh/prefix


https://github.com/rkh/prefix

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

This library implements two methods: `Array#~` and `Symbol#~`.
`Array#~` turns an `Array` into a `Set`.
`Symbol#~` turns a `Symbol` into a `respond_to?` matcher.

``` ruby
case something
when ~:to_hash then ...
when ~:to_ary then ...
else ~[1, 2, 3]
end
```

It does not reach the [threshold of originality](http://en.wikipedia.org/wiki/Threshold_of_originality),
so no license is needed.