Class: Integer
Instance Method Summary collapse
-
#even? ⇒ Boolean
Standard in ruby 1.9.
-
#odd? ⇒ Boolean
Standard in ruby 1.9.
-
#ord ⇒ Object
Standard in ruby 1.9.
-
#pred ⇒ Object
Standard in ruby 1.9.
-
#succ ⇒ Object
Standard in ruby 1.9.
Instance Method Details
#even? ⇒ Boolean
Standard in ruby 1.9. See official documentation
3 4 5 |
# File 'lib/backports/integer.rb', line 3 def even? self[0].zero? end |
#odd? ⇒ Boolean
Standard in ruby 1.9. See official documentation
8 9 10 |
# File 'lib/backports/integer.rb', line 8 def odd? !even? end |
#ord ⇒ Object
Standard in ruby 1.9. See official documentation
13 14 15 |
# File 'lib/backports/integer.rb', line 13 def ord self end |
#pred ⇒ Object
Standard in ruby 1.9. See official documentation
23 24 25 |
# File 'lib/backports/integer.rb', line 23 def pred self - 1 end |
#succ ⇒ Object
Standard in ruby 1.9. See official documentation
18 19 20 |
# File 'lib/backports/integer.rb', line 18 def succ self + 1 end |