Skip to content

Instantly share code, notes, and snippets.

@alloy
Created June 18, 2009 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alloy/132020 to your computer and use it in GitHub Desktop.
Save alloy/132020 to your computer and use it in GitHub Desktop.
ARGF.close raises an IOError if called on a closed stream
ARGF.each_line returns self when passed a block
ARGF.each returns self when passed a block
Bignum#<=> returns 1 when self is Infinity and other is a Bignum
Bignum#<=> returns 1 when self is negative and other is Infinty
Bignum#<=> returns 1 when self is Infinity and other is a Bignum
Bignum#<=> returns 1 when self is negative and other is Infinty
File.join calls #to_path
Float#<=> returns 1 when self is Infinity and other is a Bignum
Float#<=> returns 1 when self is negative and other is Infinty
Float#<=> returns 1 when self is Infinity and other is a Bignum
Float#<=> returns 1 when self is negative and other is Infinty
Float#denominator returns an Integer
Float#denominator converts self to a Rational and returns the denominator
Float#denominator returns 1 for NaN and Infinity
Float#fdiv performs floating-point division between self and a Fixnum
Float#fdiv performs floating-point division between self and a Rational
Float#fdiv performs floating-point division between self and a Complex
Float#fdiv raises a TypeError when argument isn't numeric
Numeric#numerator converts self to a Rational object then returns its numerator
Numeric#numerator returns 0 for 0.0
Numeric#numerator returns NaN for NaN
Numeric#numerator returns Infinity for Infinity
Numeric#numerator returns -Infinity for Infinity
Integer#gcd returns self if equal to the argument
Integer#gcd returns an Integer
Integer#gcd returns the greatest common divisor of self and argument
Integer#gcd returns a positive integer even if self is negative
Integer#gcd returns a positive integer even if the argument is negative
Integer#gcd returns a positive integer even if both self and argument are negative
Integer#gcd accepts a Bignum argument
Integer#gcd works if self is a Bignum
Integer#gcd raises an ArgumentError if not given an argument
Integer#gcd raises an ArgumentError if given more than one argument
Integer#gcd raises an ArgumentError unless the argument is an Integer
Integer#gcdlcm returns [self, self] if self is equal to the argument
Integer#gcdlcm returns an Array
Integer#gcdlcm returns a two-element Array
Integer#gcdlcm returns the greatest common divisor of self and argument as the first element
Integer#gcdlcm returns the least common multiple of self and argument as the last element
Integer#gcdlcm accepts a Bignum argument
Integer#gcdlcm works if self is a Bignum
Integer#gcdlcm raises an ArgumentError if not given an argument
Integer#gcdlcm raises an ArgumentError if given more than one argument
Integer#gcdlcm raises an ArgumentError unless the argument is an Integer
Integer#lcm returns self if equal to the argument
Integer#lcm returns an Integer
Integer#lcm returns the least common multiple of self and argument
Integer#lcm returns a positive integer even if self is negative
Integer#lcm returns a positive integer even if the argument is negative
Integer#lcm returns a positive integer even if both self and argument are negative
Integer#lcm accepts a Bignum argument
Integer#lcm works if self is a Bignum
Integer#lcm raises an ArgumentError if not given an argument
Integer#lcm raises an ArgumentError if given more than one argument
Integer#lcm raises an ArgumentError unless the argument is an Integer
Integer#to_r returns a Rational object
Integer#to_r constructs a rational number with self as the numerator
Integer#to_r constructs a rational number with 1 as the denominator
Integer#to_r works even if self is a Bignum
Integer#to_r raises an ArgumentError if given any arguments
IO.new does not close the stream automatically if given a block
IO.open with a block swallows StandardErrors produced by close
Kernel#require stores relative paths as absolute paths in $LOADED_FEATURES
Kernel#require stores ./file paths as absolute paths in $LOADED_FEATURES
Kernel#require performs tilde expansion before storing paths in $LOADED_FEATURES
Kernel#require collapses '../' inside an absolute path before storing in $LOADED_FEATURES
Kernel#require uses $LOADED_FEATURES to see whether file is already loaded
Kernel#require will not load a file whose path appears in $LOADED_FEATURES; it will return false
Kernel#require raises a LoadError if the file exists but can't be read
Numeric#magnitude returns self when self is greater than 0
Numeric#magnitude returns self#@- when self is less than 0
Numeric#numerator converts self to a Rational object then returns its numerator
Rational() passed two arguments returns a Rational instance
Rational() passed two arguments sets the numerator to the first argument
Rational() passed two arguments sets the denominator to the second argument
Rational() passed two arguments automatically reduces the Rational
Rational() passed Integer returns a new Rational number with 1 as the denominator
Rational#abs returns self's absolute value
Rational#ceil returns an Integer
Rational#ceil returns the smallest integer >= self as an integer
Rational#coerce returns the passed argument, self as Float, when given a Float
Rational#coerce returns the passed argument, self as Rational, when given an Integer
Rational#coerce returns [argument, self] when given a Rational
Rational#<=> when passed a Rational object returns 1 when self is greater than the passed argument
Rational#<=> when passed a Rational object returns 0 when self is equal to the passed argument
Rational#<=> when passed a Rational object returns -1 when self is less than the passed argument
Rational#<=> when passed a Integer object returns 1 when self is greater than the passed argument
Rational#<=> when passed a Integer object returns 0 when self is equal to the passed argument
Rational#<=> when passed a Integer object returns -1 when self is less than the passed argument
Rational#<=> when passed a Float object returns 1 when self is greater than the passed argument
Rational#<=> when passed a Float object returns 0 when self is equal to the passed argument
Rational#<=> when passed a Float object returns -1 when self is less than the passed argument
Rational#<=> when passed an Object that responds to #coerce calls #coerce on the passed argument with self
Rational#<=> when passed an Object that responds to #coerce calls #<=> on the coerced Rational with the coerced Object
Rational#denominator returns the denominator
Rational#denominator returns 1 if no denominator was given
Rational#div returns an Integer
Rational#div raises an ArgumentError if passed more than one argument
Rational#div raises a TypeError if passed a non-numeric argument
Rational#div passed a Rational performs integer division and returns the result
Rational#div passed a Rational raises a ZeroDivisionError when the argument has a numerator of 0
Rational#div passed a Rational raises a ZeroDivisionError when the argument has a numerator of 0.0
Rational#div passed an Integer performs integer division and returns the result
Rational#div passed an Integer raises a ZeroDivisionError when the argument is 0
Rational#div passed a Float performs integer division and returns the result
Rational#div passed a Float raises a FloatDomainError when the argument is 0.0
Rational#/ calls #coerce on the passed argument with self
Rational#/ calls #/ on the coerced Rational with the coerced Object
Rational#/ when passed an Integer returns self divided by other as a Rational
Rational#/ when passed an Integer raises a ZeroDivisionError when passed 0
Rational#/ when passed a Rational returns self divided by other as a Rational
Rational#/ when passed a Rational raises a ZeroDivisionError when passed a Rational with a numerator of 0
Rational#/ when passed a Float returns self divided by other as a Float
Rational#/ when passed a Float returns infinity when passed 0
Rational#divmod when passed a Rational returns the quotient as Integer and the remainder as Rational
Rational#divmod when passed a Rational raises a ZeroDivisonError when passed a Rational with a numerator of 0
Rational#divmod when passed an Integer returns the quotient as Integer and the remainder as Rational
Rational#divmod when passed an Integer raises a ZeroDivisionError when passed 0
Rational#divmod when passed a Float returns the quotient as Integer and the remainder as Float
Rational#divmod when passed a Float returns the quotient as Integer and the remainder as Float
Rational#divmod when passed a Float raises a FloatDomainError when passed 0
Rational#== returns the result of calling #== with self on the passed argument
Rational#== when passed a Rational returns true if self has the same numerator and denominator as the passed argument
Rational#== when passed a Float converts self to a Float and compares it with the passed argument
Rational#== when passed an Integer returns true if self has the passed argument as numerator and a denominator of 1
Rational#** calls #coerce on the passed argument with self
Rational#** calls #** on the coerced Rational with the coerced Object
Rational#** when passed Rational returns self raised to the argument as a Rational if possible
Rational#** when passed Rational returns self raised to the argument as a Float if necessary
Rational#** when passed Rational returns NaN when self is negative and the passed argument is not 0
Rational#** when passed Float returns self converted to Float and raised to the passed argument
Rational#** when passed Float returns 1.0 when the passed argument is 0
Rational#** when passed Float returns NaN if self is negative and the passed argument is not 0
Rational#** when pass Integer returns the Rational value of self raised to the passed argument
Rational#** when pass Integer returns Rational(1, 1) when the passed argument is 0
Rational#hash is static
Rational#inspect returns a string representation of self
Rational#- calls #coerce on the passed argument with self
Rational#- calls #- on the coerced Rational with the coerced Object
Rational#% returns the remainder when this value is divided by other
Rational#% returns a Float value when the argument is Float
Rational#% raises ZeroDivisionError on zero denominator
Rational#% raises FloatDomainError when the argument is 0.0
Rational#* calls #coerce on the passed argument with self
Rational#* calls #* on the coerced Rational with the coerced Object
Rational#* passed a Rational returns self divided by other as a Rational
Rational#* passed a Float returns self divided by other as a Float
Rational#* passed an Integer returns self divided by other as a Rational
Rational#numerator returns the numerator
Rational#+ calls #coerce on the passed argument with self
Rational#+ calls #+ on the coerced Rational with the coerced Object
Rational#+ with a Rational returns the result of substracting other from self as a Rational
Rational#+ with a Float returns the result of substracting other from self as a Float
Rational#+ with an Integer returns the result of substracting other from self as a Rational
Rational#quo calls #coerce on the passed argument with self
Rational#quo calls #/ on the coerced Rational with the coerced Object
Rational#to_f returns self converted to a Float
Rational#to_i converts self to an Integer by truncation
Rational#to_i converts self to an Integer by truncation
Rational#to_r returns self
Rational#to_s returns a string representation of self ERROR
NoMethodError: undefined method `Rational:' for #<NSObject:0x8022e9460>
0:in `protect:'
0:in `each'
0:in `protect:'
0:in `each'
0:in `process'
0:in `describe:'
0:in `context:'
0:in `ruby_version_is:'
0:in `protect:'
0:in `each'
0:in `files'
0:in `process'
0:in `run'
Finished in 127.262382 seconds
1229 files, 5136 examples, 14497 expectations, 47 failures, 164 errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment