Results for: "uri"

Returns true if self is a prime number, else returns false. Not recommended for very big integers (> 10**23).

Returns the Integer index of the last occurrence of the given substring, or nil if none found:

'foo'.rindex('f') # => 0
'foo'.rindex('o') # => 2
'foo'.rindex('oo') # => 1
'foo'.rindex('ooo') # => nil

Returns the Integer index of the last match for the given Regexp regexp, or nil if none found:

'foo'.rindex(/f/) # => 0
'foo'.rindex(/o/) # => 2
'foo'.rindex(/oo/) # => 1
'foo'.rindex(/ooo/) # => nil

The last match means starting at the possible last position, not the last of longest matches.

'foo'.rindex(/o+/) # => 2
$~ #=> #<MatchData "o">

To get the last longest match, needs to combine with negative lookbehind.

'foo'.rindex(/(?<!o)o+/) # => 1
$~ #=> #<MatchData "oo">

Or String#index with negative lookforward.

'foo'.index(/o+(?!.*o)/) # => 1
$~ #=> #<MatchData "oo">

Integer argument offset, if given and non-negative, specifies the maximum starting position in the

string to _end_ the search:
 'foo'.rindex('o', 0) # => nil
 'foo'.rindex('o', 1) # => 1
 'foo'.rindex('o', 2) # => 2
 'foo'.rindex('o', 3) # => 2

If offset is a negative Integer, the maximum starting position in the string to end the search is the sum of the string’s length and offset:

'foo'.rindex('o', -1) # => 2
'foo'.rindex('o', -2) # => 1
'foo'.rindex('o', -3) # => nil
'foo'.rindex('o', -4) # => nil

Related: String#index

Returns a copy of the receiver with leading and trailing whitespace removed.

Whitespace is defined as any of the following characters: null, horizontal tab, line feed, vertical tab, form feed, carriage return, space.

"    hello    ".strip   #=> "hello"
"\tgoodbye\r\n".strip   #=> "goodbye"
"\x00\t\n\v\f\r ".strip #=> ""
"hello".strip           #=> "hello"

Returns a copy of the receiver with leading whitespace removed. See also String#rstrip and String#strip.

Refer to String#strip for the definition of whitespace.

"  hello  ".lstrip   #=> "hello  "
"hello".lstrip       #=> "hello"

Returns a copy of the receiver with trailing whitespace removed. See also String#lstrip and String#strip.

Refer to String#strip for the definition of whitespace.

"  hello  ".rstrip   #=> "  hello"
"hello".rstrip       #=> "hello"

Removes leading and trailing whitespace from the receiver. Returns the altered receiver, or nil if there was no change.

Refer to String#strip for the definition of whitespace.

"  hello  ".strip!  #=> "hello"
"hello".strip!      #=> nil

Removes leading whitespace from the receiver. Returns the altered receiver, or nil if no change was made. See also String#rstrip! and String#strip!.

Refer to String#strip for the definition of whitespace.

"  hello  ".lstrip!  #=> "hello  "
"hello  ".lstrip!    #=> nil
"hello".lstrip!      #=> nil

Removes trailing whitespace from the receiver. Returns the altered receiver, or nil if no change was made. See also String#lstrip! and String#strip!.

Refer to String#strip for the definition of whitespace.

"  hello  ".rstrip!  #=> "  hello"
"  hello".rstrip!    #=> nil
"hello".rstrip!      #=> nil

Returns the current fiber. You need to require 'fiber' before using this method. If you are not running in the context of a fiber this method will return the root fiber.

Returns an array containing all of the filenames in the given directory. Will raise a SystemCallError if the named directory doesn’t exist.

The optional encoding keyword argument specifies the encoding of the directory. If not specified, the filesystem encoding is used.

Dir.entries("testdir")   #=> [".", "..", "config.h", "main.rb"]

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.

With no arguments, sets the default visibility for subsequently defined methods to private. With arguments, sets the named methods to have private visibility. String arguments are converted to symbols. An Array of Symbols and/or Strings are also accepted.

module Mod
  def a()  end
  def b()  end
  private
  def c()  end
  private :a
end
Mod.private_instance_methods   #=> [:a, :c]

Note that to show a private method on RDoc, use :doc:.

Print an argument or list of arguments to the default output stream

cgi = CGI.new
cgi.print    # default:  cgi.print == $DEFAULT_OUTPUT.print

Returns true if the date is Thursday.

Returns true if the date is Friday.

Returns true if the date is Saturday.

No documentation available

Returns true if the date is on or after the day of calendar reform.

Date.new(1582,10,15).gregorian?          #=> true
(Date.new(1582,10,15) - 1).gregorian?    #=> false

This method is equivalent to new_start(Date::GREGORIAN).

Returns the hour (0-23).

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

Returns the hour of the day (0..23) for time.

t = Time.now   #=> 2007-11-19 08:26:20 -0600
t.hour         #=> 8

Returns true if time represents Thursday.

t = Time.local(1995, 12, 21)     #=> 1995-12-21 00:00:00 -0600
t.thursday?                      #=> true

Returns true if time represents Friday.

t = Time.local(1987, 12, 18)     #=> 1987-12-18 00:00:00 -0600
t.friday?                        #=> true

Returns true if time represents Saturday.

t = Time.local(2006, 6, 10)      #=> 2006-06-10 00:00:00 -0500
t.saturday?                      #=> true
No documentation available
Search took: 11ms  ·  Total Results: 811