Results for: "partition"

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?.

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.

Returns false

Returns the second in range (0..59):

DateTime.new(2001, 2, 3, 4, 5, 6).sec # => 6

Returns the timezone.

DateTime.parse('04pm+0730').zone          #=> "+07:30"

Returns the integer month of the year for self, in range (1..12):

t = Time.new(2000, 1, 2, 3, 4, 5, 6)
# => 2000-01-02 03:04:05 +000006
t.mon # => 1

Related: Time#year, Time#hour, Time#min.

Returns the integer month of the year for self, in range (1..12):

t = Time.new(2000, 1, 2, 3, 4, 5, 6)
# => 2000-01-02 03:04:05 +000006
t.mon # => 1

Related: Time#year, Time#hour, Time#min.

Returns the integer year for self:

t = Time.new(2000, 1, 2, 3, 4, 5, 6)
# => 2000-01-02 03:04:05 +000006
t.year # => 2000

Related: Time#mon, Time#hour, Time#min.

Returns the string name of the time zone for self:

Time.utc(2000, 1, 1).zone # => "UTC"
Time.new(2000, 1, 1).zone # => "Central Standard Time"

Returns true if self represents a Monday, false otherwise:

t = Time.utc(2000, 1, 3) # => 2000-01-03 00:00:00 UTC
t.monday?                # => true

Related: Time#tuesday?, Time#wednesday?, Time#thursday?.

Flushes input and output buffers in kernel.

You must require ‘io/console’ to use this method.

Reads and returns a line without echo back. Prints prompt unless it is nil.

The newline character that terminates the read line is removed from the returned string, see String#chomp!.

You must require ‘io/console’ to use this method.

require 'io/console'
IO::console.getpass("Enter password:")
Enter password:
# => "mypassword"

Returns an File instance opened console.

If sym is given, it will be sent to the opened console with args and the result will be returned instead of the console IO itself.

You must require ‘io/console’ to use this method.

Search took: 3ms  ·  Total Results: 2857