Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rkh/prefix
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/rkh/prefix
- Owner: rkh
- Created: 2012-03-20T14:47:08.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-03-20T15:01:24.000Z (over 12 years ago)
- Last Synced: 2024-04-25T12:20:17.551Z (7 months ago)
- Language: Ruby
- Size: 89.8 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.