Results for: "partition"

Returns the real (absolute) pathname of pathname in the actual filesystem not containing symlinks or useless dots.

If dir_string is given, it is used as a base directory for interpreting relative pathname instead of the current directory.

All components of the pathname must exist when this method is called.

Returns the real (absolute) pathname of pathname in the actual filesystem. The real pathname doesn’t contain symlinks or useless dots.

If dir_string is given, it is used as a base directory for interpreting relative pathname instead of the current directory.

The last component of the real pathname can be nonexistent.

Returns the string representation of the path

File.path(File::NULL)           #=> "/dev/null"
File.path(Pathname.new("/tmp")) #=> "/tmp"

Splits the given string into a directory and a file component and returns them in a two-element array. See also File::dirname and File::basename.

File.split("/home/gumby/.profile")   #=> ["/home/gumby", ".profile"]

Returns true if the named file is writable by the effective user and group id of this process. See eaccess(3).

Note that some OS-level security features may cause this to return true even though the file is not writable by the effective user/group.

Returns true if filepath points to a character device, false otherwise.

File.chardev?($stdin)     # => true
File.chardev?('t.txt')     # => false

Returns the receiver.

string = "my string"
string.itself.object_id == string.object_id   #=> true

Return the arguments passed in as the third parameter to the constructor.

In the first form, returns an array of the names of all constants accessible from the point of call. This list includes the names of all modules and classes defined in the global scope.

Module.constants.first(4)
   # => [:ARGF, :ARGV, :ArgumentError, :Array]

Module.constants.include?(:SEEK_SET)   # => false

class IO
  Module.constants.include?(:SEEK_SET) # => true
end

The second form calls the instance method constants.

Returns an array of the names of the constants accessible in mod. This includes the names of constants in any included modules (example at start of section), unless the inherit parameter is set to false.

The implementation makes no guarantees about the order in which the constants are yielded.

IO.constants.include?(:SYNC)        #=> true
IO.constants(false).include?(:SYNC) #=> false

Also see Module#const_defined?.

Limit the number of significant digits in newly created BigDecimal numbers to the specified value. Rounding is performed as necessary, as specified by BigDecimal.mode.

A limit of 0, the default, means no upper limit.

The limit specified by this method takes less priority over any limit specified to instance methods such as ceil, floor, truncate, or round.

Splits a BigDecimal number into four parts, returned as an array of values.

The first value represents the sign of the BigDecimal, and is -1 or 1, or 0 if the BigDecimal is Not a Number.

The second value is a string representing the significant digits of the BigDecimal, with no leading zeros.

The third value is the base used for arithmetic (currently always 10) as an Integer.

The fourth value is an Integer exponent.

If the BigDecimal can be represented as 0.xxxxxx*10**n, then xxxxxx is the string of significant digits with no leading zeros, and n is the exponent.

From these values, you can translate a BigDecimal to a float as follows:

sign, significant_digits, base, exponent = a.split
f = sign * "0.#{significant_digits}".to_f * (base ** exponent)

(Note that the to_f method is provided as a more convenient way to translate a BigDecimal to a Float.)

No documentation available

Returns the square root of the value.

Result has at least n significant digits.

Returns self if the value is non-zero, nil otherwise.

Returns the exponent of the BigDecimal number, as an Integer.

If the number can be represented as 0.xxxxxx*10**n where xxxxxx is a string of digits with no leading zeros, then n is the exponent.

Returns nil, -1, or +1 depending on whether the value is finite, -Infinity, or +Infinity.

Returns True if the value is finite (not NaN or infinite).

Returns the absolute value of rat.

(1/2r).abs    #=> (1/2)
(-1/2r).abs   #=> (1/2)

Returns the year:

Date.new(2001, 2, 3).year    # => 2001
(Date.new(1, 1, 1) - 1).year # => 0

Returns the month in range (1..12):

Date.new(2001, 2, 3).mon # => 2

Returns the month in range (1..12):

Date.new(2001, 2, 3).mon # => 2

Returns commercial-date year for self (see Date.commercial):

Date.new(2001, 2, 3).cwyear # => 2001
Date.new(2000, 1, 1).cwyear # => 1999

Returns true if self is a Monday, false otherwise.

Equivalent to Date#new_start with argument Date::ITALY.

Search took: 5ms  ·  Total Results: 3946