Type:
Class

Add double dispatch to Integer

Integer is the basis for the two concrete classes that hold whole numbers, Bignum and Fixnum.

even?
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.even? â true or false Instance Public methods Returns true

2025-01-10 15:47:30
rationalize
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.rationalize([eps]) â rational Instance Public methods Returns the value

2025-01-10 15:47:30
chr
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.chr([encoding]) â string Instance Public methods Returns a string containing

2025-01-10 15:47:30
to_i
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.to_i â integerint.to_int â integer Instance Public methods As

2025-01-10 15:47:30
to_d
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.to_d â bigdecimal Instance Public methods Convert int to

2025-01-10 15:47:30
floor
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.floor â integer Instance Public methods As int is already

2025-01-10 15:47:30
gcd
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.gcd(int2) â integer Instance Public methods Returns the greatest common

2025-01-10 15:47:30
downto
  • References/Ruby on Rails/Ruby/Classes/Symbol

int.downto(limit) {|i| block } â selfint.downto(limit) â an_enumerator Instance Public methods

2025-01-10 15:47:30
each
  • References/Ruby on Rails/Ruby/Classes/Symbol

each() Instance Public methods Alias for:

2025-01-10 15:47:30
to_bn
  • References/Ruby on Rails/Ruby/Classes/Symbol

to_bn() Instance Public methods

2025-01-10 15:47:30