Preview: nonzero%3f-i.yaml
Size: 706 B
//proc/thread-self/root/opt/alt/ruby18/share/ri/1.8/system/Numeric/nonzero%3f-i.yaml
--- !ruby/object:RI::MethodDescription
aliases: []
block_params:
comment:
- !ruby/struct:SM::Flow::P
body: "Returns <em>num</em> if <em>num</em> is not zero, <tt>nil</tt> 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
Directory Contents
Dirs: 0 × Files: 32