Results for: "module_function"

Returns the argument unchanged. Just for compatibility to IO.

Pushes back one character (passed as a parameter) such that a subsequent buffered read will return it. There is no limitation for multiple pushbacks including pushing back behind the beginning of the buffer string.

See IO#ungetbyte

Sets the scan pointer to the previous position. Only one previous position is remembered, and it changes with each scanning operation.

s = StringScanner.new('test string')
s.scan(/\w+/)        # => "test"
s.unscan
s.scan(/../)         # => "te"
s.scan(/\d/)         # => nil
s.unscan             # ScanError: unscan failed: previous match record not exist

Returns a string that represents the StringScanner object, showing:

disconnects OLE server. If this method called, then the WIN32OLE_EVENT object does not receive the OLE server event any more. This method is trial implementation.

ie = WIN32OLE.new('InternetExplorer.Application')
ev = WIN32OLE_EVENT.new(ie)
ev.on_event() {...}
   ...
ev.unadvise

Returns help context.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbooks')
method = WIN32OLE_METHOD.new(tobj, 'Add')
puts method.helpcontext # => 65717

Returns the method name with class name.

Returns the parameter name with class name. If the parameter has default value, then returns name=value string with class name.

Returns the OLE struct name and member name and the value of member

If COM server in VB.NET ComServer project is the following:

Imports System.Runtime.InteropServices
Public Class ComClass
    <MarshalAs(UnmanagedType.BStr)> _
    Public title As String
    Public cost As Integer
End Class

then

srver = WIN32OLE.new('ComServer.ComClass')
obj = WIN32OLE_RECORD.new('Book', server)
obj.inspect # => <WIN32OLE_RECORD(ComClass) {"title" => nil, "cost" => nil}>

Returns helpcontext. If helpcontext is not found, then returns nil.

tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Worksheet')
puts tobj.helpfile # => 131185

Returns the type name with class name.

ie = WIN32OLE.new('InternetExplorer.Application')
ie.ole_type.inspect => #<WIN32OLE_TYPE:IWebBrowser2>

Returns the type library name with class name.

tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 9.0 Object Library')
tlib.inspect # => "<#WIN32OLE_TYPELIB:Microsoft Excel 9.0 Object Library>"

Returns the OLE variable name and the value with class name.

Returns a new String containing the hash entries:

h = {foo: 0, bar: 1, baz: 2}
h.inspect # => "{:foo=>0, :bar=>1, :baz=>2}"

Hash#to_s is an alias for Hash#inspect.

Returns a new Hash object whose entries are all those from self for which the block returns false or nil:

h = {foo: 0, bar: 1, baz: 2}
h1 = h.reject {|key, value| key.start_with?('b') }
h1 # => {:foo=>0}

Returns a new Enumerator if no block given:

h = {foo: 0, bar: 1, baz: 2}
e = h.reject # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:reject>
h1 = e.each {|key, value| key.start_with?('b') }
h1 # => {:foo=>0}

Returns self, whose remaining entries are those for which the block returns false or nil:

h = {foo: 0, bar: 1, baz: 2}
h.reject! {|key, value| value < 2 } # => {:baz=>2}

Returns nil if no entries are removed.

Returns a new Enumerator if no block given:

h = {foo: 0, bar: 1, baz: 2}
e = h.reject! # => #<Enumerator: {:foo=>0, :bar=>1, :baz=>2}:reject!>
e.each {|key, value| key.start_with?('b') } # => {:foo=>0}

Returns a copy of self with all nil-valued entries removed:

h = {foo: 0, bar: nil, baz: 2, bat: nil}
h1 = h.compact
h1 # => {:foo=>0, :baz=>2}

Returns self with all its nil-valued entries removed (in place):

h = {foo: 0, bar: nil, baz: 2, bat: nil}
h.compact! # => {:foo=>0, :baz=>2}

Returns nil if no entries were removed.

Methods has_key?, key?, and member? are aliases for #include?.

Returns true if key is a key in self, otherwise false.

Yields each environment variable name and its value as a 2-element Array. Returns a Hash whose items are determined by the block. When the block returns a truthy value, the name/value pair is added to the return Hash; otherwise the pair is ignored:

ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
ENV.reject { |name, value| name.start_with?('b') } # => {"foo"=>"0"}

Returns an Enumerator if no block given:

e = ENV.reject
e.each { |name, value| name.start_with?('b') } # => {"foo"=>"0"}

Similar to ENV.delete_if, but returns nil if no changes were made.

Yields each environment variable name and its value as a 2-element Array, deleting each environment variable for which the block returns a truthy value, and returning ENV (if any deletions) or nil (if not):

ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
ENV.reject! { |name, value| name.start_with?('b') } # => ENV
ENV # => {"foo"=>"0"}
ENV.reject! { |name, value| name.start_with?('b') } # => nil

Returns an Enumerator if no block given:

ENV.replace('foo' => '0', 'bar' => '1', 'baz' => '2')
e = ENV.reject! # => #<Enumerator: {"bar"=>"1", "baz"=>"2", "foo"=>"0"}:reject!>
e.each { |name, value| name.start_with?('b') } # => ENV
ENV # => {"foo"=>"0"}
e.each { |name, value| name.start_with?('b') } # => nil

Returns the contents of the environment as a String:

ENV.replace('foo' => '0', 'bar' => '1')
ENV.inspect # => "{\"bar\"=>\"1\", \"foo\"=>\"0\"}"

ENV.has_key?, ENV.member?, and ENV.key? are aliases for ENV.include?.

Returns true if there is an environment variable with the given name:

ENV.replace('foo' => '0', 'bar' => '1')
ENV.include?('foo') # => true

Returns false if name is a valid String and there is no such environment variable:

ENV.include?('baz') # => false

Returns false if name is the empty String or is a String containing character '=':

ENV.include?('') # => false
ENV.include?('=') # => false

Raises an exception if name is a String containing the NUL character "\0":

ENV.include?("\0") # Raises ArgumentError (bad environment variable name: contains null byte)

Raises an exception if name has an encoding that is not ASCII-compatible:

ENV.include?("\xa1\xa1".force_encoding(Encoding::UTF_16LE))
# Raises ArgumentError (bad environment variable name: ASCII incompatible encoding: UTF-16LE)

Raises an exception if name is not a String:

ENV.include?(Object.new) # TypeError (no implicit conversion of Object into String)

Reads at most maxlen bytes from the ARGF stream.

If the optional outbuf argument is present, it must reference a String, which will receive the data. The outbuf will contain only the received data after the method call even if it is not empty at the beginning.

It raises EOFError on end of ARGF stream. Since ARGF stream is a concatenation of multiple files, internally EOF is occur for each file. ARGF.readpartial returns empty strings for EOFs except the last one and raises EOFError for the last one.

Search took: 7ms  ·  Total Results: 3202