No commit activity in last 3 years
No release in over 3 years
backport_yield_self is the backport of Kernel#yield_self in Ruby 2.5 to older Ruby versions.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 3.0.0
 Project Readme

backport_yield_self Build Status Gem Version

backport_yield_self is the backport of Kernel#yield_self in Ruby 2.5 to older Ruby versions.

The best way is to use Ruby 2.5 or later. Because you can use original yield_self method and so on.

Installation

Add these lines to your application's Gemfile:

gem 'backport_yield_self'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install backport_yield_self

And require it as:

require 'backport_yield_self'

Synopsis

'my string'.yield_self {|s| s.upcase } #=> "MY STRING"
3.next.yield_self {|x| x**x }.to_s     #=> "256"

Supported Ruby versions

  • Ruby 2.2
  • Ruby 2.3
  • Ruby 2.4

Contributing

  1. Fork it
  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 new Pull Request

License

backport_yield_self is released under the MIT License.

Get the original codes

Special Thanks

  • Ruby Development Team