DuckPuncher
Currently have the following punches in our repertoire:
- Array#m - alias for
map(&:)
, usage:[1].m(:succ)
- Hash#seek - usage:
{a: 1, b: {c: 2}}.seek(:b, :c) #=> 2
- Numeric#to_currency - usage:
25.245.to_currency #=> '25.25'
- Numeric#to_duration - usage
10_000.to_duration #=> '2 h 46 min'
- Numeric#to_time_ago - usage
10_000.to_time_ago #=> '2 hours ago'
- Numeric#to_rad - usage
10.15.to_rad #=> 0.17715091907742445
- String#pluralize - usage
'hour'.pluralize(2) #=> 'hours'
Installation
Add this line to your application's Gemfile:
gem 'duck_puncher'
And then execute:
$ bundle
Or install it yourself as:
$ gem install duck_puncher
Usage
TODO: Write usage instructions here
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request