size

rng.size â num
Instance Public methods

Returns the number of elements in the range. Both the begin and the end of the Range must be Numeric, otherwise nil is returned.

(10..20).size    #=> 11
('a'..'z').size  #=> nil
(-Float::INFINITY..Float::INFINITY).size #=> Infinity
doc_ruby_on_rails
2015-05-01 02:09:59
Comments
Leave a Comment

Please login to continue.