Results for: "OptionParser"

No documentation available

Returns true iff all elements are zero.

The coerce method provides support for Ruby type coercion. This coercion mechanism is used by Ruby to handle mixed-type numeric operations: it is intended to find a compatible common type between the two operands of the operator. See also Numeric#coerce.

Returns a two-element array containing the beginning and ending offsets of the nth match. n can be a string or symbol to reference a named capture.

m = /(.)(.)(\d+)(\d)/.match("THX1138.")
m.offset(0)      #=> [1, 7]
m.offset(4)      #=> [6, 7]

m = /(?<foo>.)(.)(?<bar>.)/.match("hoge")
p m.offset(:foo) #=> [0, 1]
p m.offset(:bar) #=> [2, 3]

Returns the array of captures; equivalent to mtch.to_a[1..-1].

f1,f2,f3,f4 = /(.)(.)(\d+)(\d)/.match("THX1138.").captures
f1    #=> "H"
f2    #=> "X"
f3    #=> "113"
f4    #=> "8"

Returns the path to the data store file.

Looks up all IP address for name.

Looks up all IP address for name.

Returns true if the set contains no elements.

Removes all elements and returns self.

set = Set[1, 'c', :s]             #=> #<Set: {1, "c", :s}>
set.clear                         #=> #<Set: {}>
set                               #=> #<Set: {}>
No documentation available

Returns true if the set is a subset of the given set.

Equivalent to Set#keep_if, but returns nil if no changes were made. Returns an enumerator if no block is given.

Equivalent to Set#select!

Merges the elements of the given enumerable object to the set and returns self.

No documentation available

Resets the internal state after modification to existing elements and returns self.

Elements will be reindexed and deduplicated.

Pops a directory from the directory stack, and sets the current directory to it.

No documentation available
No documentation available

Opens or reopens the file with mode “r+”.

Closes the file. If unlink_now is true, then the file will be unlinked (deleted) after closing. Of course, you can choose to later call unlink if you do not unlink it now.

If you don’t explicitly unlink the temporary file, the removal will be delayed until the object is finalized.

Closes and unlinks (deletes) the file. Has the same effect as called close(true).

Returns the full path name of the temporary file. This will be nil if unlink has been called.

Creates a new Tempfile.

If no block is given, this is a synonym for Tempfile.new.

If a block is given, then a Tempfile object will be constructed, and the block is run with said object as argument. The Tempfile object will be automatically closed after the block terminates. The call returns the value of the block.

In any case, all arguments (*args) will be passed to Tempfile.new.

Tempfile.open('foo', '/home/temp') do |f|
   # ... do something with f ...
end

# Equivalent:
f = Tempfile.open('foo', '/home/temp')
begin
   # ... do something with f ...
ensure
   f.close
end
Search took: 3ms  ·  Total Results: 4416