Skip to content
backport_yield_self is the backport of Kernel#yield_self in Ruby 2.5 to older Ruby versions.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
ext/backport_yield_self
lib
spec
.rspec
.travis.yml
CHANGELOG.md
Gemfile
Gemfile.lock
LICENSE
Manifest.txt
README.md
Rakefile
backport_yield_self.gemspec

README.md

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
You can’t perform that action at this time.