`

`cmd` â string Instance Public methods Returns the standard output of running cmd in a subshell. The built-in syntax %x{...} uses this method. Sets $? to the process status. `date` #=> "Wed Apr 9 08:56:30 CDT 2003\n" `ls testdir`.split[1] #=> "main.rb" `echo oops && exit 99` #=> "oops\n" $?.exitstatus #=> 99

__method__

__method__ â symbol__callee__ â symbol Instance Public methods Returns the name of the current method as a Symbol. If called outside of a method, it returns nil.

__dir__

__dir__ â string Instance Public methods Returns the canonicalized absolute path of the directory of the file from which this method is called. It means symlinks in the path is resolved. If __FILE__ is nil, it returns nil. The return value equals to File.dirname(File.realpath(__FILE__)).

__callee__

__callee__() Instance Public methods

String

String(arg) â string Instance Public methods Returns arg as an String. First tries to call its to_str method, then its to_s method. String(self) #=> "main" String(self.class) #=> "Object" String(123456) #=> "123456"

Rational

Rational(x[, y]) â numeric Instance Public methods Returns x/y; Rational(1, 2) #=> (1/2) Rational('1/2') #=> (1/2) Rational(nil) #=> TypeError Rational(1, nil) #=> TypeError Syntax of string form: string form = extra spaces , rational , extra spaces ; rational = [ sign ] , unsigned rational ; unsigned rational = numerator | numerator , "/" , denominator ; numerator = integer part | fractional part | integer part , fractional part ; denominator = digits ; integ

Pathname

Pathname(p1) Instance Public methods Creates a new Pathname object.

Integer

Integer(arg,base=0) â integer Instance Public methods Converts arg to a Fixnum or Bignum. Numeric types are converted directly (with floating point numbers being truncated). base (0, or between 2 and 36) is a base for integer string representation. If arg is a String, when base is omitted or equals to zero, radix indicators (0, 0b, and 0x) are honored. In any case, strings should be strictly conformed to numeric representation. This behavior is different from that of String

Hash

Hash(arg) â hash Instance Public methods Converts arg to a Hash by calling arg.to_hash. Returns an empty Hash when arg is nil or []. Hash([]) #=> {} Hash(nil) #=> nil Hash(key: :value) #=> {:key => :value} Hash([1, 2, 3]) #=> TypeError

Float

Float(arg) â float Instance Public methods Returns arg converted to a float. Numeric types are converted directly, the rest are converted using arg.to_f. As of Ruby 1.8, converting nil generates a TypeError. Float(1) #=> 1.0 Float("123.456") #=> 123.456