Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/johnjansen/clamp
Clamp for Comparable in Crystal-Lang
https://github.com/johnjansen/clamp
Last synced: about 1 month ago
JSON representation
Clamp for Comparable in Crystal-Lang
- Host: GitHub
- URL: https://github.com/johnjansen/clamp
- Owner: johnjansen
- License: mit
- Created: 2017-07-11T04:40:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-11T05:03:09.000Z (over 7 years ago)
- Last Synced: 2024-08-01T17:34:12.797Z (4 months ago)
- Language: Crystal
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - clamp - Clamp any Comparable (Examples and funny stuff)
- awesome-crystal - clamp - Clamp any Comparable (Examples and funny stuff)
README
# clamp
[![GitHub version](https://badge.fury.io/gh/johnjansen%2Fclamp.svg)](http://badge.fury.io/gh/johnjansen%2Fclamp)
[![CI](https://travis-ci.org/johnjansen/clamp.svg?branch=master)](https://travis-ci.org/johnjansen/clamp)implements `#clamp` on any `Comparable`
```
'a'.clamp('b', 'c') # => 'b'
'b'.clamp('a', 'c') # => 'b'
'd'.clamp('a', 'c') # => 'c'
...
```## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
clamp:
github: johnjansen/clamp
```## Usage
```crystal
require "clamp"
```## Contributing
1. Fork it ( https://github.com/johnjansen/clamp/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [johnjansen](https://github.com/johnjansen) John Jansen - creator, maintainer