_DEFAULT_MASTER

_DEFAULT_MASTER() Class Public methods

upto

int.upto(limit) {|i| block } â selfint.upto(limit) â an_enumerator Instance Public methods Iterates block, passing in integer values from int up to and including limit. If no block is given, an enumerator is returned instead. 5.upto(10) { |i| print i, " " } produces: 5 6 7 8 9 10

truncate

int.truncate â integer Instance Public methods As int is already an Integer, all these methods simply return the receiver.

to_r

int.to_r â rational Instance Public methods Returns the value as a rational. 1.to_r #=> (1/1) (1<<64).to_r #=> (18446744073709551616/1)

to_int

int.to_int â integer Instance Public methods As int is already an Integer, all these methods simply return the receiver.

to_i

int.to_i â integerint.to_int â integer Instance Public methods As int is already an Integer, all these methods simply return the receiver.

to_d

int.to_d â bigdecimal Instance Public methods Convert int to a BigDecimal and return it. require 'bigdecimal' require 'bigdecimal/util' 42.to_d # => #<BigDecimal:1008ef070,'0.42E2',9(36)>

to_bn

to_bn() Instance Public methods

times

int.times {|i| block } â selfint.times â an_enumerator Instance Public methods Iterates block int times, passing in values from zero to int - 1. If no block is given, an enumerator is returned instead. 5.times do |i| print i, " " end produces: 0 1 2 3 4 each

succ

int.succ â integer Instance Public methods Returns the Integer equal to int + 1. 1.next #=> 2 (-1).next #=> 0