• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/4

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

4 Cards in this Set

  • Front
  • Back

#to_i

to_i → integer

As int is already an Integer, all these methods simply return the receiver.

Synonyms: to_int, floor, ceil, truncate.

#chr

chr([encoding]) → string




Returns a string containing the character represented by the int‘s value according to encoding.




Example


65.chr #=> "A"


230.chr #=> "\346"


255.chr(Encoding::UTF_8) #=> "\303\277"

#downto

downto(limit) {|i| block } → self

downto(limit) → an_enumerator


Iterates the given block, passing decreasing values from int down to and including limit.


If no block is given, an Enumerator is returned instead.


Example

5.downto(1) { |n| print n, ".. " }

print " Liftoff!\n"

#=> "5.. 4.. 3.. 2.. 1.. Liftoff!"

#even?

even? → true or false

Returns true if int is an even number.


Example

5.even? #=> false

2.even? #=> true