A simple gem for a method that always returns void.
Add this line to your application's Gemfile:
gem 'void_method', '~> 1.0'And then execute:
$ bundleOr you can install the gem on its own:
gem install void_methodCall the void method to declaratively execute code and return nil:
void do
# some code that returns a value to be ignored
end
# => nilThe block is passed the receiver of void as parameter, so it can be used like tap and then.
If Kernel#void is already defined, the gem raises an exception.
Void Method loosely follows Semantic Versioning, with a hard guarantee that breaking changes to the public API will always coincide with an increase to the MAJOR number.
Version numbers are in three parts: MAJOR.MINOR.PATCH.
- Breaking changes to the public API increment the
MAJOR. There may also be changes that would otherwise increase theMINORor thePATCH. - Additions, deprecations, and "big" non breaking changes to the public API increment the
MINOR. There may also be changes that would otherwise increase thePATCH. - Bug fixes and "small" non breaking changes to the public API increment the
PATCH.
Notice that any feature deprecated by a minor release can be expected to be removed by the next major release.
Full list of changes in CHANGELOG.md
Bug reports and pull requests are welcome on GitHub at https://github.com/moku-io/void_method.
The gem is available as open source under the terms of the MIT License.