Results for: "pstore"

Returns the “rest” of the string (i.e. everything after the scan pointer). If there is no more data (eos? = true), it returns "".

s.restsize is equivalent to s.rest_size. This method is obsolete; use rest_size instead.

Returns help string of OLE method. If the help string is not found, then the method returns nil.

Example
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
method = WIN32OLE_METHOD.new(tobj, 'Navigate')
puts method.helpstring # => Navigates to a URL or file.

Returns help string.

Example
tobj = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'IWebBrowser')
puts tobj.helpstring # => Web Browser interface

Calls the block with each row read from source path or io.

Without Option headers

Without option headers, returns each row as an Array object.

These examples assume prior execution of:

Example
string = "foo,0\nbar,1\nbaz,2\n"
path = 't.csv'
File.write(path, string)

Read rows from a file at path:

Example
CSV.foreach(path) {|row| p row }

Output:

Example
["foo", "0"]
["bar", "1"]
["baz", "2"]

Read rows from an IO object:

Example
File.open(path) do |file|
  CSV.foreach(file) {|row| p row }
end

Output:

Example
["foo", "0"]
["bar", "1"]
["baz", "2"]

Returns a new Enumerator if no block given:

Example
CSV.foreach(path) # => #<Enumerator: CSV:foreach("t.csv", "r")>
CSV.foreach(File.open(path)) # => #<Enumerator: CSV:foreach(#<File:t.csv>, "r")>

Issues a warning if an encoding is unsupported:

Example
CSV.foreach(File.open(path), encoding: 'foo:bar') {|row| }

Output:

warning: Unsupported encoding foo ignored
warning: Unsupported encoding bar ignored
With Option headers

With {option headers}, returns each row as a CSV::Row object.

These examples assume prior execution of:

Example
string = "Name,Count\nfoo,0\nbar,1\nbaz,2\n"
path = 't.csv'
File.write(path, string)

Read rows from a file at path:

Example
CSV.foreach(path, headers: true) {|row| p row }

Output:

Example
#<CSV::Row "Name":"foo" "Count":"0">
#<CSV::Row "Name":"bar" "Count":"1">
#<CSV::Row "Name":"baz" "Count":"2">

Read rows from an IO object:

Example
File.open(path) do |file|
  CSV.foreach(file, headers: true) {|row| p row }
end

Output:

Example
#<CSV::Row "Name":"foo" "Count":"0">
#<CSV::Row "Name":"bar" "Count":"1">
#<CSV::Row "Name":"baz" "Count":"2">

Raises an exception if path is a String, but not the path to a readable file:

Example
# Raises Errno::ENOENT (No such file or directory @ rb_sysopen - nosuch.csv):
CSV.foreach('nosuch.csv') {|row| }

Raises an exception if io is an IO object, but not open for reading:

Example
io = File.open(path, 'w') {|row| }
# Raises TypeError (no implicit conversion of nil into String):
CSV.foreach(io) {|row| }

Raises an exception if mode is invalid:

Example
# Raises ArgumentError (invalid access mode nosuch):
CSV.foreach(path, 'nosuch') {|row| }

Returns the (row, column) cofactor which is obtained by multiplying the first minor by (-1)**(row + column).

Example
Matrix.diagonal(9, 5, -3, 4).cofactor(1, 1)
#  => -108

Creates a single-row matrix from this vector.

Add separator in summary.

Stops execution of the current thread, putting it into a “sleep” state, and schedules execution of another thread.

Example
a = Thread.new { print "a"; Thread.stop; print "c" }
sleep 0.1 while a.status!='sleep'
print "b"
a.run
a.join
#=> "abc"

Returns true if thr is dead or sleeping.

Example
a = Thread.new { Thread.stop }
b = Thread.current
a.stop?   #=> true
b.stop?   #=> false

See also alive? and status.

Loads the given name, returning true if successful and false if the feature is already loaded.

If the filename neither resolves to an absolute path nor starts with ‘./’ or ‘../’, the file will be searched for in the library directories listed in $LOAD_PATH ($:). If the filename starts with ‘./’ or ‘../’, resolution is based on Dir.pwd.

If the filename has the extension “.rb”, it is loaded as a source file; if the extension is “.so”, “.o”, or “.dll”, or the default shared library extension on the current platform, Ruby loads the shared library as a Ruby extension. Otherwise, Ruby tries adding “.rb”, “.so”, and so on to the name until found. If the file named cannot be found, a LoadError will be raised.

For Ruby extensions the filename given may use any shared library extension. For example, on Linux the socket extension is “socket.so” and require 'socket.dll' will load the socket extension.

The absolute path of the loaded file is added to $LOADED_FEATURES ($"). A file will not be loaded again if its path already appears in $". For example, require 'a'; require './a' will not load a.rb again.

Example
require "my-library.rb"
require "db-driver"

Any constants or globals within the loaded source file will be available in the calling program’s global namespace. However, local variables will not be propagated to the loading environment.

Deprecated. Use block_given? instead.

Returns current status of GC stress mode.

Updates the GC stress mode.

When stress mode is enabled, the GC is invoked at every GC opportunity: all memory and object allocations.

Enabling stress mode will degrade performance, it is only for debugging.

flag can be true, false, or an integer bit-ORed following flags.

Example
0x01:: no major GC
0x02:: no immediate sweep
0x04:: full mark after malloc/calloc/realloc
No documentation available

Refresh available gems from disk.

Breaks the buffer into lines that are shorter than maxwidth

No documentation available
No documentation available
No documentation available

Shortcut for defining multiple delegator methods, but with no provision for using a different name. The following two code samples have the same effect:

Example
def_delegators :@records, :size, :<<, :map

def_delegator :@records, :size
def_delegator :@records, :<<
def_delegator :@records, :map

Define method as delegator instance method with an optional alias name ali. Method calls to ali will be delegated to accessor.method. accessor should be a method name, instance variable name, or constant name. Use the full path to the constant if providing the constant name. Returns the name of the method defined.

Example
class MyQueue
  CONST = 1
  extend Forwardable
  attr_reader :queue
  def initialize
    @queue = []
  end

  def_delegator :@queue, :push, :mypush
  def_delegator 'MyQueue::CONST', :to_i
end

q = MyQueue.new
q.mypush 42
q.queue    #=> [42]
q.push 23  #=> NoMethodError
q.to_i     #=> 1
No documentation available

Called with encoding when the YAML stream starts. This method is called once per stream. A stream may contain multiple documents.

See the constants in Psych::Parser for the possible values of encoding.

No documentation available
Search took: 1ms  ·  Total Results: 2928