Project

why_not

0.0
No commit activity in last 3 years
No release in over 3 years
not_empty?, not_blank?, not_defined? ... why not? This is Ruby, come on.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.2.0, < 0.3.0
 Project Readme

WhyNot?¶ ↑

not_empty?, not_blank?, … why_not? Tired of writing !array.empty? Ruby is ledgible and should be more ledgible. Ruby is terse and should be terser. A predicate method is one that returns a boolean and ends in a question mark. This simple library adds corresponding negation methods for all Ruby predicate methods.

Resources¶ ↑

Install

  • sudo gem install why_not

Use

  • require ‘why_not’

Usage¶ ↑

In general

array = %w(one two three)
array.empty?  # => false
array.not_empty? # => true

value = nil
value.nil? # => true
value.not_nil? # => false

[].is_not_a?(Array) # => false
[].isnt_a?(String) # => true

Dependencies¶ ↑

  • rubygems

  • meta_programming