Skip to content

Latest commit

 

History

History
47 lines (29 loc) · 1.44 KB

README.md

File metadata and controls

47 lines (29 loc) · 1.44 KB

ExtendsBool

Maintainability Build Status

Add .to_bool behaviour to the follow classes:

  • String
  • Integer
  • Float
  • Array
  • Hash
  • TrueClass
  • FalseClass
  • NilClass

Installation

Add this line to your application's Gemfile:

gem 'extends_bool'

And then execute:

$ bundle

Or install it yourself as:

$ gem install extends_bool

Usage

Simple, if the variable have any of [nil, false, 0, 0.0, "", "0", "f", "false", "off", [], {}] values, will return false, else, returns true.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/extends_bool. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the ExtendsBool project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.