wannabe_bool

an implementation of prodis/wannabe_bool gem in Crystal

wannabe_bool

An implementation of prodis/wannabe_bool in Crystal

Installation

Add this to your application's shard.yml:

dependencies:
  wannabe_bool:
    github: llamicron/wannabe_bool
    branch: master

Usage

require "wannabe_bool"

Strings, nil, symbols, and integers can be casted to booleans with:

nil.to_b      # => false
"true".to_b   # => true
"y".to_b      # => true
"false".to_b  # => false
"string".to_b # => false
:true.to_b    # => true
:false.to_b   # => true
1.to_b        # => true
0.to_b        # => false

Contributing

  1. Fork it ( https://github.com/llamicron/wannabe_bool/fork )
  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 a new Pull Request

Contributors

  • llamicron | Luke Sweeney - creator, maintainer
Repository

wannabe_bool

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 0
  • over 7 years ago
  • May 4, 2017
License

MIT License

Links
Synced at

Fri, 22 Nov 2024 02:49:57 GMT

Languages