--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: "Returns num if num is not zero, nil otherwise. This behavior is useful when chaining comparisons:"
- !ruby/struct:SM::Flow::VERB
body: " a = %w( z Bb bB bb BB a aA Aa AA A )\n b = a.sort {|a,b| (a.downcase <=> b.downcase).nonzero? || a <=> b }\n b #=> ["A", "a", "AA", "Aa", "aA", "BB", "Bb", "bB", "bb", "z"]\n"
full_name: Numeric#nonzero?
is_singleton: false
name: nonzero?
params: |
num.nonzero? => num or nil
visibility: public